You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/12/12 17:01:41 UTC

[GitHub] [netbeans] mbien opened a new pull request, #5091: update OutputUtils to support stacktrace links leading to JDK files.

mbien opened a new pull request, #5091:
URL: https://github.com/apache/netbeans/pull/5091

   fixes #4516
   
    - add active JDK to class path
    - fix the packageName parsing of the line action
   
   I might add a cleanup commit later or via followup PR.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] lbownik commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
lbownik commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1047435684


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

Review Comment:
   if this code is being tuched anyway, why not removing this ugly "new Object [] {" and let the compiler do it for us?



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1046180339


##########
java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java:
##########
@@ -241,7 +244,8 @@ public ProjectStacktraceOutputListener(Project project) {
         protected ClassPath getClassPath() {
             Project prj = ref.get();
             if(prj != null) {
-                ClassPath[] cp = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class).getProjectClassPaths(ClassPath.EXECUTE);
+                ProjectSourcesClassPathProvider provider = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class);
+                ClassPath[] cp = provider.getProjectClassPaths(ClassPath.BOOT);

Review Comment:
   it doesn't contain maven deps. Going to revert to the original version.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#issuecomment-1375170734

   all green. merging.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1049102697


##########
java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java:
##########
@@ -241,8 +258,12 @@ public ProjectStacktraceOutputListener(Project project) {
         protected ClassPath getClassPath() {
             Project prj = ref.get();
             if(prj != null) {
-                ClassPath[] cp = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class).getProjectClassPaths(ClassPath.EXECUTE);
-                return ClassPathSupport.createProxyClassPath(cp);
+                ProjectSourcesClassPathProvider prov = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class);
+                List<ClassPath> cp = Stream.concat(
+                        Stream.of(prov.getProjectClassPaths(ClassPath.BOOT)),
+                        Stream.of(prov.getProjectClassPaths(ClassPath.EXECUTE)))
+                    .collect(Collectors.toList());

Review Comment:
   the result has also just a handful of classpath objects.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1046128206


##########
java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java:
##########
@@ -241,7 +244,8 @@ public ProjectStacktraceOutputListener(Project project) {
         protected ClassPath getClassPath() {
             Project prj = ref.get();
             if(prj != null) {
-                ClassPath[] cp = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class).getProjectClassPaths(ClassPath.EXECUTE);
+                ProjectSourcesClassPathProvider provider = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class);
+                ClassPath[] cp = provider.getProjectClassPaths(ClassPath.BOOT);

Review Comment:
   first version i tested indeed merged both but the application is already included in the boot cp.
   
   going to step through the lazy eval lambda hell of ClassPathProviderImpl later and check if this is just a bug or by design. Maven deps is another case i have to check



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1054760511


##########
java/maven/src/org/netbeans/modules/maven/classpath/ClassPathProviderImpl.java:
##########
@@ -370,7 +305,13 @@ private ClassPath getRuntimeClasspath(int type) {
     
     private ClassPath getJava8RunTimeClassPath(int type) {
         final int ftype = type == TYPE_WEB ? TYPE_SRC : type;
-        return computeIfAbsent(JAVA8_RUNTIME_PATH + ftype, () -> ClassPathFactory.createClassPath(ftype == TYPE_SRC ? new RuntimeClassPathImpl(getNBMavenProject()) : new TestRuntimeClassPathImpl(getNBMavenProject(), false)));
+        return computeIfAbsent(JAVA8_RUNTIME_PATH + ftype,
+                () -> ClassPathFactory.createClassPath(
+                        ftype == TYPE_SRC
+                            ? new RuntimeClassPathImpl(getNBMavenProject())
+                            : new TestRuntimeClassPathImpl(getNBMavenProject(), false)
+                )
+        );

Review Comment:
   they are in a separate commit. I am not squashing PRs if they contain a code change commit and a cleanup commit.
   
   I don't feel its needed to create separate PRs in many cases - this does also conserve CI resources.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] lbownik commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
lbownik commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1047422345


##########
java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java:
##########
@@ -241,8 +258,12 @@ public ProjectStacktraceOutputListener(Project project) {
         protected ClassPath getClassPath() {
             Project prj = ref.get();
             if(prj != null) {
-                ClassPath[] cp = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class).getProjectClassPaths(ClassPath.EXECUTE);
-                return ClassPathSupport.createProxyClassPath(cp);
+                ProjectSourcesClassPathProvider prov = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class);
+                List<ClassPath> cp = Stream.concat(
+                        Stream.of(prov.getProjectClassPaths(ClassPath.BOOT)),
+                        Stream.of(prov.getProjectClassPaths(ClassPath.EXECUTE)))
+                    .collect(Collectors.toList());

Review Comment:
   it's a reallly overcomplicated (and not very efficient) way of cancatenating arrays :)
   how about using something like this
   
   static <T> T[] concat(T[] array1, T[] array2) {
       T[] result = Arrays.copyOf(array1, array1.length + array2.length);
       System.arraycopy(array2, 0, result, array1.length, array2.length);
       return result;
   }



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1048693609


##########
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:
   yep thats a good idea since the same snippet is used twice which is another reason to extract it.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien merged pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien merged PR #5091:
URL: https://github.com/apache/netbeans/pull/5091


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jglick commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
jglick commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1054756178


##########
java/maven/src/org/netbeans/modules/maven/classpath/ClassPathProviderImpl.java:
##########
@@ -370,7 +305,13 @@ private ClassPath getRuntimeClasspath(int type) {
     
     private ClassPath getJava8RunTimeClassPath(int type) {
         final int ftype = type == TYPE_WEB ? TYPE_SRC : type;
-        return computeIfAbsent(JAVA8_RUNTIME_PATH + ftype, () -> ClassPathFactory.createClassPath(ftype == TYPE_SRC ? new RuntimeClassPathImpl(getNBMavenProject()) : new TestRuntimeClassPathImpl(getNBMavenProject(), false)));
+        return computeIfAbsent(JAVA8_RUNTIME_PATH + ftype,
+                () -> ClassPathFactory.createClassPath(
+                        ftype == TYPE_SRC
+                            ? new RuntimeClassPathImpl(getNBMavenProject())
+                            : new TestRuntimeClassPathImpl(getNBMavenProject(), false)
+                )
+        );

Review Comment:
   There is no change in code here IIUC? It would be helpful to have stylistic / reformatting changes clearly marked as such and be in separate PRs, rather than intermixed with behavioral changes or refactorings.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#issuecomment-1375111085

   > consider nbjavac. When it is declared as a dependency it overrides the built-in javac although normal classloading behavior would be to prefer the boot classpath. So my assumption would be, that people having dependencies clashing with JDK classes would ensure that the classloaders are setup to prefer these. But that is a niche use-case, so feel free to disagree and merge as is.
   
   @matthiasblaesing That is a good point. I thought about this before and wasn't sure either. But I think having project-cp before boot cp might be indeed the better default for stack trace linking. Swapped it now and rebased to latest master for a fresh build.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1048691219


##########
java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java:
##########
@@ -241,8 +258,12 @@ public ProjectStacktraceOutputListener(Project project) {
         protected ClassPath getClassPath() {
             Project prj = ref.get();
             if(prj != null) {
-                ClassPath[] cp = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class).getProjectClassPaths(ClassPath.EXECUTE);
-                return ClassPathSupport.createProxyClassPath(cp);
+                ProjectSourcesClassPathProvider prov = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class);
+                List<ClassPath> cp = Stream.concat(
+                        Stream.of(prov.getProjectClassPaths(ClassPath.BOOT)),
+                        Stream.of(prov.getProjectClassPaths(ClassPath.EXECUTE)))
+                    .collect(Collectors.toList());

Review Comment:
   i rather not start playing with indices unless there is a good reason for that. I am more concerned about correctness and readability here. 
   A proper implementation will probably have to retain the module info somehow. But this should work in many if not most cases.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] neilcsmith-net commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1046109466


##########
java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java:
##########
@@ -241,7 +244,8 @@ public ProjectStacktraceOutputListener(Project project) {
         protected ClassPath getClassPath() {
             Project prj = ref.get();
             if(prj != null) {
-                ClassPath[] cp = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class).getProjectClassPaths(ClassPath.EXECUTE);
+                ProjectSourcesClassPathProvider provider = prj.getLookup().lookup(ProjectSourcesClassPathProvider.class);
+                ClassPath[] cp = provider.getProjectClassPaths(ClassPath.BOOT);

Review Comment:
   Are you sure that still works for anything _not_ in the JDK?  I would expect to have `ClassPath.BOOT` added to `ClassPath.EXECUTE` in there?



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1049088228


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

Review Comment:
   the advantage of this is to delay when the toString() method is called to the point the logging lib is building the message, it doesn't make a difference in this particular case but the whole class is using this way of logging. I don't really feel the need to rewrite it all.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] lbownik commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#issuecomment-1362253969

   rebased to latest master


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on a diff in pull request #5091: update OutputUtils to support stacktrace links leading to JDK files.

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1054765500


##########
java/maven/src/org/netbeans/modules/maven/classpath/ClassPathProviderImpl.java:
##########
@@ -370,7 +305,13 @@ private ClassPath getRuntimeClasspath(int type) {
     
     private ClassPath getJava8RunTimeClassPath(int type) {
         final int ftype = type == TYPE_WEB ? TYPE_SRC : type;
-        return computeIfAbsent(JAVA8_RUNTIME_PATH + ftype, () -> ClassPathFactory.createClassPath(ftype == TYPE_SRC ? new RuntimeClassPathImpl(getNBMavenProject()) : new TestRuntimeClassPathImpl(getNBMavenProject(), false)));
+        return computeIfAbsent(JAVA8_RUNTIME_PATH + ftype,
+                () -> ClassPathFactory.createClassPath(
+                        ftype == TYPE_SRC
+                            ? new RuntimeClassPathImpl(getNBMavenProject())
+                            : new TestRuntimeClassPathImpl(getNBMavenProject(), false)
+                )
+        );

Review Comment:
   added do-not-squash label



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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