mbien commented on code in PR #5482:
URL: https://github.com/apache/netbeans/pull/5482#discussion_r1105821968


##########
java/maven/src/org/netbeans/modules/maven/options/MavenSettings.java:
##########
@@ -480,6 +484,19 @@ public void setBinaryDownloadStrategy(DownloadStrategy ds) 
{
             }
         }
 
+        Pattern mavenCoreJarPattern = 
Pattern.compile("maven-core-(\\d+\\.\\d+\\.\\d+)\\.jar");  // NOI18N

Review Comment:
   could be further extracted to a static final field (sorry that I didn't 
suggest it right away).



##########
java/maven/src/org/netbeans/modules/maven/options/MavenSettings.java:
##########
@@ -480,6 +484,19 @@ public void setBinaryDownloadStrategy(DownloadStrategy ds) 
{
             }
         }
 
+        Pattern mavenCoreJarPattern = 
Pattern.compile("maven-core-(\\d+\\.\\d+\\.\\d+)\\.jar");  // NOI18N
+        try (Stream<String> mavenCoreVersions = Files.list(lib)
+                .map(file -> file.getFileName())

Review Comment:
   could map to `file.getFileName().toString()` since the next two steps work 
with Strings (remove `toString()` there).
   
   javadoc of `getFileName` says "a path representing the name of the file or 
directory, or null if this path has zero elements", so we hopefully don't have 
to worry about null here (famous last words before NPE :)).



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