Modify

Opened 2 years ago

Closed 22 months ago

Last modified 17 months ago

#19724 closed enhancement (fixed)

Add compatibility with Java 16

Reported by: simon04 Owned by: Don-vip
Priority: normal Milestone: 21.02
Component: Core Version:
Keywords: java16 Cc: stoecker, Stereo

Description (last modified by Don-vip)

Followup of #18755

First ​​EA builds of Java 16 are available.

See #20522 for Java 17 compatibility.

Attachments (0)

Change History (42)

comment:1 Changed 2 years ago by simon04

In 17134/josm:

see #19724 - Update to EqualsVerifier 3.4.3

Might need -Dnet.bytebuddy.experimental=true to work.

CHANGELOG: https://github.com/jqno/equalsverifier/blob/8b5fd50b2fc65a387835f203d3538e0fd6efb55a/CHANGELOG.md

comment:2 Changed 2 years ago by simon04

In 17198/josm:

see #19724 - EqualsVerifier: net.bytebuddy.experimental=true for Java 16

comment:3 Changed 2 years ago by Don-vip

Build broke with errorprone. I created this bug report:

    [javac] /var/lib/jenkins/jobs/Java-EarlyAccess-JOSM/workspace/jdk/JDK16/src/org/openstreetmap/josm/tools/LanguageInfo.java:2: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
    [javac] package org.openstreetmap.josm.tools;
    [javac] ^
    [javac]      Please report this at https://github.com/google/error-prone/issues/new and include the following:
    [javac]   
    [javac]      error-prone version: 2.4.0
    [javac]      BugPattern: AlmostJavadoc
    [javac]      Stack Trace:
    [javac]      java.lang.NoSuchFieldError: reader
    [javac]   	at com.google.errorprone.util.ErrorProneTokens$CommentSavingTokenizer.processComment(ErrorProneTokens.java:85)
    [javac]   	at jdk.compiler/com.sun.tools.javac.parser.JavaTokenizer.readToken(JavaTokenizer.java:919)
    [javac]   	at jdk.compiler/com.sun.tools.javac.parser.Scanner.nextToken(Scanner.java:115)
    [javac]   	at com.google.errorprone.util.ErrorProneTokens.getTokens(ErrorProneTokens.java:57)
    [javac]   	at com.google.errorprone.util.ErrorProneTokens.getTokens(ErrorProneTokens.java:74)
    [javac]   	at com.google.errorprone.util.ErrorProneTokens.getTokens(ErrorProneTokens.java:65)
    [javac]   	at com.google.errorprone.bugpatterns.javadoc.AlmostJavadoc.matchCompilationUnit(AlmostJavadoc.java:80)
    [javac]   	at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:451)
    [javac]   	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:557)
    [javac]   	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:152)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:603)
    [javac]   	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:60)
    [javac]   	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:58)
    [javac]   	at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)
    [javac]   	at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:152)
    [javac]   	at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132)
    [javac]   	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1421)
    [javac]   	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1368)
    [javac]   	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:960)
    [javac]   	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
    [javac]   	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
    [javac]   	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
    [javac]   	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
Last edited 2 years ago by Don-vip (previous) (diff)

comment:4 Changed 2 years ago by Don-vip

Milestone: 20.1020.12

comment:5 Changed 2 years ago by Don-vip

In 17254/josm:

see #19937 - see #19724 - Enable macOS build on Java 16-ea instead of 15, add an option to disable Error-Prone at build time

comment:6 Changed 2 years ago by Don-vip

Milestone: 20.1221.01

Milestone renamed

comment:7 Changed 23 months ago by Don-vip

Error-Prone 2.5.1 has been released with Java 16 compatibility but it crashes for us, see https://github.com/google/error-prone/issues/2152

comment:8 Changed 23 months ago by Don-vip

Milestone: 21.0121.02

comment:9 Changed 23 months ago by Don-vip

In 17484/josm:

see #19724 - fix issues reported by Error-Prone 2.5.1 before it crashes

comment:10 Changed 23 months ago by Don-vip

Error-prone patch:

  • build.xml

     
    282282            <compilerarg value="-Xlint:unchecked"/>
    283283            <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
    284284            <compilerarg value="-XDignore.symbol.file"/>
    285             <compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF" unless:set="noErrorProne"/>
     285            <compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF -Xep:JavaUtilDate:OFF -Xep:DoNotCallSuggester:OFF -Xep:BanSerializableRead:OFF" unless:set="noErrorProne"/>
    286286            <compilerarg line="-Xmaxwarns 1000"/>
    287287            <classpath>
    288288                <path refid="runtime.path"/>
  • tools/ivy.xml

     
    2929        <dependency org="com.github.spotbugs" name="spotbugs" rev="4.0.1" conf="spotbugs->default"/>
    3030        <dependency org="com.github.spotbugs" name="spotbugs-ant" rev="4.0.1" conf="spotbugs->default"/>
    3131        <!-- errorprone->default -->
    32         <dependency org="com.google.errorprone" name="error_prone_core" rev="2.4.0" conf="errorprone->default"/>
     32        <dependency org="com.google.errorprone" name="error_prone_core" rev="2.5.1" conf="errorprone->default"/>
    3333        <!-- errorprone->default -->
    3434        <dependency org="com.google.errorprone" name="javac" rev="9+181-r4173-1" conf="errorprone_javac->default"/>
    3535    </dependencies>

comment:11 Changed 23 months ago by Don-vip

Owner: changed from team to Don-vip
Status: newassigned

comment:12 Changed 23 months ago by Don-vip

Cc: Don-vip removed

comment:13 Changed 22 months ago by stoecker

Milestone: 21.0221.03

Milestone renamed

comment:14 Changed 22 months ago by Don-vip

In 17515/josm:

see #19724 - update to error-prone 2.5.1, checkstyle 8.36, spotbugs 4.2.1

comment:15 Changed 22 months ago by Don-vip

Even when disabling the error-prone check that crashes, the build still fails with Java 16: https://github.com/google/error-prone/issues/2195

comment:16 Changed 22 months ago by Don-vip

In 17520/josm:

see #19724 - add Java 16 workaround suggested by Error Prone developers

comment:17 Changed 22 months ago by Don-vip

In 35710/osm:

see #19724 - update to error-prone 2.5.1

comment:18 Changed 22 months ago by Don-vip

In 17527/josm:

see #19724 - weird NPE on Jenkins with Java 16 - skip unit test

comment:19 Changed 22 months ago by Don-vip

In 17528/josm:

see #19724 - upgrade to equalsverifier 3.5.4

comment:20 Changed 22 months ago by Don-vip

Milestone: 21.0321.02

comment:21 Changed 22 months ago by Don-vip

In 17530/josm:

see #19724, see #20522 - java 16/17 support in Linux launch scripts

comment:22 Changed 22 months ago by Don-vip

In 35711/osm:

see #19724 - add Java 16 workaround suggested by Error Prone developers

comment:23 Changed 22 months ago by Don-vip

In 35712/osm:

see #19724 - add more details for NPE when running tests on Java 14+

comment:24 Changed 22 months ago by Don-vip

In 17537/josm:

see #19724 - upgrade to junit 5.7.1 + upgrade other test libs

comment:25 Changed 22 months ago by Don-vip

In 17538/josm:

see #19724, see #20522 - enable jacoco on java 16/17 + add NPE details on Java 14+ in unit tests

comment:26 Changed 22 months ago by Stereo

Should we still keep errorprone disabled for the java 16 github action?

comment:27 Changed 22 months ago by Don-vip

We can enable it, it works. I don't understand yet why JUnit fails for plugins though.

comment:28 Changed 22 months ago by Don-vip

In 17539/josm:

see #19724, see #20522 - upgrade to equalsverifier 3.5.5 - enable Java 16/17 for mac build

comment:29 Changed 22 months ago by Don-vip

In 17540/josm:

see #19724 - No idea why the test fails with Java 16+ on Linux

comment:30 Changed 22 months ago by Don-vip

In 35714/osm:

see #19724 - plugins build tuning

comment:31 Changed 22 months ago by Don-vip

Resolution: fixed
Status: assignedclosed

comment:32 Changed 22 months ago by Don-vip

In 17544/josm:

see #19724 - upgrade animal sniffer to 1.20

comment:33 Changed 22 months ago by Don-vip

In 17546/josm:

see #19724 - fix #20344 - add add-opens/add-exports directive from JNLP file to macOS build

comment:34 Changed 21 months ago by Don-vip

In 17566/josm:

see #19724 - Java 16 GA

comment:35 Changed 21 months ago by simon04

Vincent, congratulations, you are named on the Java blog as "individuals provided invaluable feedback on build quality, logged good quality bugs or offered frequent updates" – https://inside.java/2021/03/16/the-arrival-of-java16/ 🥳

comment:36 Changed 21 months ago by Don-vip

Cc: Stereo added

Haha I saw. But I think it's thanks to a macos bug reported by Stereo who probably deserves the glory.

comment:37 Changed 21 months ago by simon04

In 17572/josm:

see #19724 - Fix "'Double(double)' is deprecated"

comment:38 Changed 21 months ago by Stereo

Haha, thanks. But I'm sure they must have gotten your name for a good reason.

comment:39 Changed 21 months ago by simon04

In 17688/josm:

see #19724 - Fix NPE in PlatformHookWindows.getInstalledFonts on Linux/macOS

comment:40 Changed 21 months ago by simon04

In 17689/josm:

see #19724 - Fix WinRegistry in unit test

Add missing --add-opens java.prefs/java.util.prefs for PlatformHookWindowsTest

Unable to make private static native long[] java.util.prefs.WindowsPreferences.WindowsRegOpenKey(long,byte[],int) accessible: module java.prefs does not "opens java.util.prefs" to unnamed module ...

comment:41 Changed 19 months ago by Don-vip

Description: modified (diff)

comment:42 Changed 17 months ago by Don-vip

In 17971/josm:

fix #21059 - see #19724 - export java.base/sun.security.action to unnamed module

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.