Removed redundant checks 95/14195/1
authorshashikanth <shashikanth.vh@huawei.com>
Thu, 21 Sep 2017 09:48:25 +0000 (15:18 +0530)
committershashikanth <shashikanth.vh@huawei.com>
Thu, 21 Sep 2017 09:48:26 +0000 (15:18 +0530)
Fix Major sonar issues in aai/traversal module
https://sonar.onap.org/component_issues?id=org.onap.aai.traversal%3Atraversal#resolved=false|severities=BLOCKER

Change this condition so that it does not always evaluate to "true"

Issue-Id:AAI-212
Change-Id: I64659f0afc1cc497f31cf726a8c29b8bdf849a49
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java

index 32e8cbe..4b0f24d 100644 (file)
@@ -942,10 +942,8 @@ public class SearchGraph {
                                                invItemList.add(invItem);
                                        }
                                }
-                               if (invItemList != null) { 
-                                       inventoryItems.set("inventoryResponseItem", invItemList);
-                                       inventoryItem.set("inventoryResponseItems",  inventoryItems);
-                               }
+                               inventoryItems.set("inventoryResponseItem", invItemList);
+                               inventoryItem.set("inventoryResponseItems",  inventoryItems);
                        }
                }
                return inventoryItem;