aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-vfc-adapter
diff options
context:
space:
mode:
authorByung-Woo Jun <byung-woo.jun@ericsson.com>2018-09-04 11:52:29 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-04 11:52:29 +0000
commit5bedb02ef09f44297d514eea6ade8503fbdf73b5 (patch)
treed0a14686081123c99c5e7b1f9c48f653101fa72e /adapters/mso-vfc-adapter
parent069a4a29759bd8f057eb9ad55cf1802a4f4d60c8 (diff)
parentbc320ddfeee78560477bcc47885c7c33cf169354 (diff)
Merge "fixed sonar issue in JsonUtil.java"
Diffstat (limited to 'adapters/mso-vfc-adapter')
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
index c12cd7da05..64032e25f5 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -51,7 +53,7 @@ public class JsonUtil {
* Mapper.
*/
private static final ObjectMapper MAPPER = new ObjectMapper();
-
+ private static final String UNMARSHAL_FAIL_MSG="fail to unMarshal json";
static {
MAPPER.setConfig(MAPPER.getDeserializationConfig().without(
DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES));
@@ -82,8 +84,8 @@ public class JsonUtil {
return MAPPER.readValue(jsonstr, type);
} catch (IOException e) {
LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
- "fail to unMarshal json", e);
- throw new ApplicationException(HttpCode.BAD_REQUEST, "fail to unMarshal json");
+ UNMARSHAL_FAIL_MSG, e);
+ throw new ApplicationException(HttpCode.BAD_REQUEST, UNMARSHAL_FAIL_MSG);
}
}
@@ -100,8 +102,8 @@ public class JsonUtil {
return MAPPER.readValue(jsonstr, type);
} catch (IOException e) {
LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
- "fail to unMarshal json", e);
- throw new ApplicationException(HttpCode.BAD_REQUEST, "fail to unMarshal json");
+ UNMARSHAL_FAIL_MSG, e);
+ throw new ApplicationException(HttpCode.BAD_REQUEST, UNMARSHAL_FAIL_MSG);
}
}