You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2022/10/20 08:11:03 UTC

[jira] [Updated] (MNG-7127) NullPointerException in MavenCliTest.testStyleColors in JDK 16

     [ https://issues.apache.org/jira/browse/MNG-7127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated MNG-7127:
---------------------------------
    Fix Version/s: 4.0.0-alpha-2

> NullPointerException in MavenCliTest.testStyleColors in JDK 16
> --------------------------------------------------------------
>
>                 Key: MNG-7127
>                 URL: https://issues.apache.org/jira/browse/MNG-7127
>             Project: Maven
>          Issue Type: Bug
>          Components: Embedding, Integration Tests
>         Environment: > uname -a
> Darwin 3c22fb7b8b51.ant.amazon.com 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64
> > java --version
> openjdk 16 2021-03-16
> OpenJDK Runtime Environment Corretto-16.0.0.36.1 (build 16+36)
> OpenJDK 64-Bit Server VM Corretto-16.0.0.36.1 (build 16+36, mixed mode, sharing)
>            Reporter: Carlos Chacin
>            Assignee: Martin Kanters
>            Priority: Trivial
>              Labels: Java16, unit-test
>             Fix For: 3.8.2, 4.0.0-alpha-1, 4.0.0-alpha-2, 4.0.0
>
>
> h2. Given
> That I'm using JDK 16 to build https://github.com/apache/maven
> h2. When
> Executing the command to build the project locally after the git clone
> {code:java}
> mvn clean verify
> {code}
> h2. Then
> There is a failed test
> {code:java}
> [ERROR] Tests run: 14, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.929 s <<< FAILURE! - in org.apache.maven.cli.MavenCliTest
> [ERROR] testStyleColors  Time elapsed: 0.03 s  <<< ERROR!
> java.lang.NullPointerException
> 	at org.apache.maven.cli.MavenCliTest.testStyleColors(MavenCliTest.java:327)
> {code}
> h2. Possible cause:
> In JDK 8 the method Paths.get used in [ResolveFile.java#L47|https://github.com/apache/maven/blob/master/maven-embedder/src/main/java/org/apache/maven/cli/ResolveFile.java#L47] is using internally:
> {code:java}
> public static Path get(String first, String... more) {
>     return FileSystems.getDefault().getPath(first, more);
> }
> {code}
> but in JDK 16
> {code:java}
> public static Path get(String first, String... more) {
>     return Path.of(first, more);
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)