ppisl commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r947890895


##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java:
##########
@@ -161,7 +166,7 @@ public Map<String, Dependency> getDependencyMap() {
         
         private void buildDependecyMap(Dependency dependency, Map<String, 
Dependency> result) {
             String gav = createGAV(dependency.getArtifact());
-            result.put(gav, dependency);
+            result.putIfAbsent(gav, dependency);
             dependency.getChildren().forEach((childDependency) -> {

Review Comment:
   So the line above expect that there could be allredy pair gav : dependency 
in the result. In this case the dependency is not put again in the result but 
the children are recountned anyway. 



##########
extide/gradle/src/org/netbeans/modules/gradle/api/GradleBaseProject.java:
##########
@@ -206,6 +213,29 @@ public String getLicense() {
     public Map<String, File> getSubProjects() {
         return subProjects;
     }
+    
+    /**
+     * Finds a GAV for the given project. Returns {@code null} if the project 
path
+     * is not known (it is not referenced anywhere by this project), or has no 
known
+     * GAV. The project's own GAV should be always present, if defined by the 
project 
+     * file(s).
+     * 
+     * @param projectPath Gradle project path
+     * @return GAV coordinates, or {@code null}
+     * @since 2.27
+     */
+    public String findProjectGav(@NonNull String projectPath) {
+        if ("".equals(projectPath) || getPath().equals(projectPath)) {
+            String n = getName();
+            String g = getGroup();
+            String v = getVersion();
+            if (n == null || "".equals(n) || g == null || "".equals(g) || v == 
null || "".equals(v) || "unspecified".equals(v)) {  // NOI18N

Review Comment:
   Just minor. Using n.isEmpty(), q.isEmtpy() and v.isEmpty would be better 
here than the equals approach. The null check is done in the condition anyway. 



-- 
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