diff options
author | shashikanth <shashikanth.vh@huawei.com> | 2017-09-20 11:45:07 +0530 |
---|---|---|
committer | shashikanth <shashikanth.vh@huawei.com> | 2017-09-20 11:45:08 +0530 |
commit | f40092e081470b262f9dd4fea620b273a45b4629 (patch) | |
tree | 2c6842903d2187e00129d5e95d6ae70bebcbc0a5 | |
parent | a40af07cdb70ab61e06e68d020ff398cc9055828 (diff) |
Fix Blocker/Critical sonar issues
Fix Blocker/Critical sonar issues in aai/sparky-be module
https://sonar.onap.org/component_issues?id=org.openecomp.aai.sparky-be%3Asparky-be#resolved=false|severities=BLOCKER
Fixed: NullPointerException might be thrown as 'aaiQueryResult' is nullable here
NullPointerException might be thrown as 'rootNode' is nullable here
Issue-Id:AAI-342
Change-Id: Ie91d695ada7159ca002385407cf1c8e0f0d59d6d
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
-rw-r--r-- | src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java b/src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java index c825040..1e3e85c 100644 --- a/src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java +++ b/src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java @@ -338,7 +338,10 @@ public class CrossEntityReferenceSynchronizer extends AbstractEntitySynchronizer try { rootNode = mapper.readTree(jsonResult); } catch (IOException exc) { - // TODO // TODO -> LOG, waht should be logged here? + String message = "Could not deserialize JSON (representing operation result) as node tree. " + + "Operation result = " + jsonResult + ". " + exc.getLocalizedMessage(); + LOG.error(AaiUiMsgs.JSON_PROCESSING_ERROR, message); + return; } JsonNode resultData = rootNode.get("result-data"); @@ -576,7 +579,7 @@ public class CrossEntityReferenceSynchronizer extends AbstractEntitySynchronizer } } else { - String message = "Entity sync failed because AAI query failed with error " + aaiQueryResult.getResult(); + String message = "Entity sync failed because AAI query failed with error "; LOG.error(AaiUiMsgs.ENTITY_SYNC_FAILED_QUERY_ERROR, message); } |