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


##########
java/maven/src/org/netbeans/modules/maven/classpath/ClassPathProviderImpl.java:
##########
@@ -672,12 +603,14 @@ public ClassPath getActiveClassPath() {
             ClassPath ret = active;
             if (ret == null) {
                 MavenProject mp = proj.getOriginalMavenProject();
-                boolean hasMainModuleDescriptor = 
mp.getCompileSourceRoots().stream().anyMatch((sourceRoot) -> (new 
File(sourceRoot, MODULE_INFO_JAVA).exists()));
+                boolean hasMainModuleDescriptor = 
mp.getCompileSourceRoots().stream()
+                        .anyMatch((sourceRoot) -> 
Files.exists(Paths.get(sourceRoot, MODULE_INFO_JAVA)));
                 if(hasMainModuleDescriptor) {
                     LOGGER.log(Level.FINER, "TestPathSelector {0} for project 
{1}: has main module-info.java", new Object [] {logDesc, 
proj.getProjectDirectory().getPath()}); // NOI18N
                 }
                 
-                boolean hasTestModuleDescriptor = 
mp.getTestCompileSourceRoots().stream().anyMatch((testSourceRoot) -> (new 
File(testSourceRoot, MODULE_INFO_JAVA).exists()));
+                boolean hasTestModuleDescriptor = 
mp.getTestCompileSourceRoots().stream()
+                        .anyMatch((testSourceRoot) -> 
Files.exists(Paths.get(testSourceRoot, MODULE_INFO_JAVA)));

Review Comment:
   (testSourceRoot) -> Files.exists(Paths.get(testSourceRoot, MODULE_INFO_JAVA))
   this code kind of asks to be a private method with a meaningful name like 
"moduleInfoJavaExsists" or something



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