Fix Blocker/Critical sonar issues 79/13779/1
authorshashikanth <shashikanth.vh@huawei.com>
Wed, 20 Sep 2017 08:50:02 +0000 (14:20 +0530)
committershashikanth <shashikanth.vh@huawei.com>
Wed, 20 Sep 2017 08:50:02 +0000 (14:20 +0530)
Fix Blocker/Critical sonar issues in aai/resources module
https://sonar.onap.org/component_issues?id=org.onap.aai.resources%3Aresources#resolved=false|severities=BLOCKER

Fixed NullPointerException might be thrown as 'oldProp' is nullable here

Issue-Id:AAI-247
Change-Id: I83103832cc3e6de9a769ba27c9576e929e94e08d
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
aai-resources/src/main/java/org/openecomp/aai/rest/tools/ModelVersionTransformer.java

index 141d71a..d840b90 100644 (file)
@@ -285,7 +285,7 @@ public class ModelVersionTransformer extends RESTAPI {
                                                        oldVal = oldRelationshipDatum.getValue("relationship-value");
                                                }
 
-                                               if (oldProp.equals("model.model-name-version-id")) { 
+                                               if ("model.model-name-version-id".equals(oldProp)) {
                                                        // make two new relationshipDatum for use w/ the new style model
 
                                                        // you should have the model in the list of models we collected earlier