Modify

Opened 4 years ago

Closed 4 years ago

Last modified 3 years 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 by simon04, 4 years ago

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 by simon04, 4 years ago

In 17198/josm:

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

comment:3 by Don-vip, 4 years ago

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 4 years ago by Don-vip (previous) (diff)

comment:4 by Don-vip, 4 years ago

Milestone: 20.1020.12

comment:5 by Don-vip, 4 years ago

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 by Don-vip, 4 years ago

Milestone: 20.1221.01

Milestone renamed

comment:7 by Don-vip, 4 years ago

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 by Don-vip, 4 years ago

Milestone: 21.0121.02

comment:9 by Don-vip, 4 years ago

In 17484/josm:

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

comment:10 by Don-vip, 4 years ago

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 by Don-vip, 4 years ago

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

comment:12 by Don-vip, 4 years ago

Cc: Don-vip removed

comment:13 by stoecker, 4 years ago

Milestone: 21.0221.03

Milestone renamed

comment:14 by Don-vip, 4 years ago

In 17515/josm:

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

comment:15 by Don-vip, 4 years ago

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 by Don-vip, 4 years ago

In 17520/josm:

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

comment:17 by Don-vip, 4 years ago

In 35710/osm:

see #19724 - update to error-prone 2.5.1

comment:18 by Don-vip, 4 years ago

In 17527/josm:

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

comment:19 by Don-vip, 4 years ago

In 17528/josm:

see #19724 - upgrade to equalsverifier 3.5.4

comment:20 by Don-vip, 4 years ago

Milestone: 21.0321.02

comment:21 by Don-vip, 4 years ago

In 17530/josm:

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

comment:22 by Don-vip, 4 years ago

In 35711/osm:

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

comment:23 by Don-vip, 4 years ago

In 35712/osm:

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

comment:24 by Don-vip, 4 years ago

In 17537/josm:

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

comment:25 by Don-vip, 4 years ago

In 17538/josm:

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

comment:26 by Stereo, 4 years ago

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

comment:27 by Don-vip, 4 years ago

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

comment:28 by Don-vip, 4 years ago

In 17539/josm:

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

comment:29 by Don-vip, 4 years ago

In 17540/josm:

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

comment:30 by Don-vip, 4 years ago

In 35714/osm:

see #19724 - plugins build tuning

comment:31 by Don-vip, 4 years ago

Resolution: fixed
Status: assignedclosed

comment:32 by Don-vip, 4 years ago

In 17544/josm:

see #19724 - upgrade animal sniffer to 1.20

comment:33 by Don-vip, 4 years ago

In 17546/josm:

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

comment:34 by Don-vip, 4 years ago

In 17566/josm:

see #19724 - Java 16 GA

comment:35 by simon04, 4 years ago

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 by Don-vip, 4 years ago

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 by simon04, 4 years ago

In 17572/josm:

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

comment:38 by Stereo, 4 years ago

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

comment:39 by simon04, 4 years ago

In 17688/josm:

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

comment:40 by simon04, 4 years ago

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 by Don-vip, 4 years ago

Description: modified (diff)

comment:42 by Don-vip, 3 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.