lbownik commented on code in PR #5660:
URL: https://github.com/apache/netbeans/pull/5660#discussion_r1136758013


##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java:
##########
@@ -569,14 +575,19 @@ private int convert(Dependency dependency, Map<String, 
Integer> gavIndex, List<A
         List<String> childrenNodeIds = new 
ArrayList<>(dependency.getChildren().size());
         for (Dependency childDependency : dependency.getChildren()) {
             int cid = convert(childDependency, gavIndex, result);
-            childrenNodeIds.add(Integer.toString(cid));
+            if (cid != -1) {
+                childrenNodeIds.add(Integer.toString(cid));
+            }
         }
         builder.applicationDependencyNodeIds(childrenNodeIds);
         result.add(builder.build());
         return n;
     }
 
     private static String createGAV(ArtifactSpec artifact) {
+        if (artifact == null) {
+            return null;
+        }
         StringBuffer sb = new StringBuffer();

Review Comment:
   You dont have to calulate it. Just use a reasonable constant like new 
StringBuilder(150) or new StringBuilder(200) which will be enough most of the 
time.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to