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>
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");
}
} 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);
}