You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/12/21 13:01:20 UTC

[GitHub] [maven-surefire] rmannibucau commented on a change in pull request #387: [SUREFIRE-1939] Fix NPE in SystemUtils.toJdkHomeFromJvmExec if java home has 2 components

rmannibucau commented on a change in pull request #387:
URL: https://github.com/apache/maven-surefire/pull/387#discussion_r773116452



##########
File path: surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
##########
@@ -98,6 +98,15 @@ public void incorrectJdkPath()
             assertThat( SystemUtils.isJava9AtLeast( incorrect.getAbsolutePath() ) ).isFalse();
         }
 
+        @Test
+        public void incorrectJdkPathShouldNotNPE()

Review comment:
       is `jvmExecutable` set to `/opt/jdk` instead of `/opt/jdk/bin/java` in your case? this test is written to make `jdk=/opt` and `jre=/opt/jdk/` which I can understand you want a case with a single segment path but is not aligned on the description and only possible if the jdk is extracted at the root of the filesystem, is it your case? Also it means the jvmExecutable is not the executable so something is wrong higher in the processing and must be fixed preventing this NPE later so I would rather chase this cause instead of swallowing it.
   
   Any inputs on these points?




-- 
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: issues-unsubscribe@maven.apache.org

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