Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK21 compatibility #3843

Closed
pburka opened this issue Mar 29, 2023 · 1 comment
Closed

JDK21 compatibility #3843

pburka opened this issue Mar 29, 2023 · 1 comment

Comments

@pburka
Copy link

pburka commented Mar 29, 2023

Testing on an early build of JDK21, errorprone 2.18.0 is failing with stack traces like the following:

An exception has occurred in the compiler (21-xxxx). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
com.google.common.util.concurrent.ExecutionError: java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree$JCExpression com.sun.tools.javac.tree.TreeMaker.Select(com.sun.tools.javac.tree.JCTree$JCExpression, com.sun.tools.javac.code.Symbol)'
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2053)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3966)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3989)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4950)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4956)
	at com.google.errorprone.dataflow.DataFlow.methodDataflow(DataFlow.java:176)
	at com.google.errorprone.dataflow.DataFlow.expressionDataflow(DataFlow.java:236)
	at com.google.errorprone.dataflow.nullnesspropagation.NullnessAnalysis.getNullness(NullnessAnalysis.java:59)
	at com.google.errorprone.bugpatterns.AbstractReferenceEquality.getNullness(AbstractReferenceEquality.java:224)
	at com.google.errorprone.bugpatterns.AbstractReferenceEquality.addFixes(AbstractReferenceEquality.java:128)
	at com.google.errorprone.bugpatterns.AbstractReferenceEquality.matchBinary(AbstractReferenceEquality.java:83)
	at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:449)
	at com.google.errorprone.scanner.ErrorProneScanner.visitBinary(ErrorProneScanner.java:512)
	at com.google.errorprone.scanner.ErrorProneScanner.visitBinary(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBinary.accept(JCTree.java:2186)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
	at jdk.compiler/com.sun.source.util.TreeScanner.visitParenthesized(TreeScanner.java:661)
	at com.google.errorprone.scanner.ErrorProneScanner.visitParenthesized(ErrorProneScanner.java:799)
	at com.google.errorprone.scanner.ErrorProneScanner.visitParenthesized(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCParens.accept(JCTree.java:2042)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
	at jdk.compiler/com.sun.source.util.TreeScanner.visitIf(TreeScanner.java:485)
	at com.google.errorprone.scanner.ErrorProneScanner.visitIf(ErrorProneScanner.java:654)
	at com.google.errorprone.scanner.ErrorProneScanner.visitIf(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1585)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)
	at jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:272)
	at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:520)
	at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1100)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)
	at jdk.compiler/com.sun.source.util.TreeScanner.visitTry(TreeScanner.java:435)
	at com.google.errorprone.scanner.ErrorProneScanner.visitTry(ErrorProneScanner.java:845)
	at com.google.errorprone.scanner.ErrorProneScanner.visitTry(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:1480)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)
	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)
	at jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:272)
	at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:520)
	at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1100)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)
	at jdk.compiler/com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:224)
	at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:740)
	at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:944)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)
	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)
	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:119)
	at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:203)
	at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:548)
	at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:851)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)
	at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)
	at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:119)
	at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:152)
	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:560)
	at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:150)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:619)
	at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:66)
	at com.google.errorprone.scanner.Scanner.scan(Scanner.java:58)
	at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)
	at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:156)
	at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1411)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1358)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:950)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
Caused by: java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree$JCExpression com.sun.tools.javac.tree.TreeMaker.Select(com.sun.tools.javac.tree.JCTree$JCExpression, com.sun.tools.javac.code.Symbol)'
	at org.checkerframework.errorprone.javacutil.trees.TreeBuilder.buildIteratorMethodAccess(TreeBuilder.java:122)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitEnhancedForLoop(CFGTranslationPhaseOne.java:2728)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitEnhancedForLoop(CFGTranslationPhaseOne.java:197)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCEnhancedForLoop.accept(JCTree.java:1248)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.scan(CFGTranslationPhaseOne.java:550)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitBlock(CFGTranslationPhaseOne.java:2206)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitBlock(CFGTranslationPhaseOne.java:197)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1100)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.scan(CFGTranslationPhaseOne.java:550)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitIf(CFGTranslationPhaseOne.java:3111)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitIf(CFGTranslationPhaseOne.java:197)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1585)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.scan(CFGTranslationPhaseOne.java:550)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitBlock(CFGTranslationPhaseOne.java:2206)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitBlock(CFGTranslationPhaseOne.java:197)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1100)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.scan(CFGTranslationPhaseOne.java:550)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitTry(CFGTranslationPhaseOne.java:3439)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitTry(CFGTranslationPhaseOne.java:197)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:1480)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.scan(CFGTranslationPhaseOne.java:550)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitBlock(CFGTranslationPhaseOne.java:2206)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.visitBlock(CFGTranslationPhaseOne.java:197)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1100)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.scan(CFGTranslationPhaseOne.java:550)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.process(CFGTranslationPhaseOne.java:447)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGTranslationPhaseOne.process(CFGTranslationPhaseOne.java:498)
	at org.checkerframework.errorprone.dataflow.cfg.builder.CFGBuilder.build(CFGBuilder.java:70)
	at com.google.errorprone.dataflow.DataFlow$2.load(DataFlow.java:127)
	at com.google.errorprone.dataflow.DataFlow$2.load(DataFlow.java:95)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3533)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2282)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2159)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
	... 92 more
@cushon
Copy link
Collaborator

cushon commented Mar 30, 2023

Caused by: java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree$JCExpression com.sun.tools.javac.tree.TreeMaker.Select(com.sun.tools.javac.tree.JCTree$JCExpression, com.sun.tools.javac.code.Symbol)'
	at org.checkerframework.errorprone.javacutil.trees.TreeBuilder.buildIteratorMethodAccess(TreeBuilder.java:122)

This is typetools/checker-framework#5672

copybara-service bot pushed a commit that referenced this issue May 18, 2023
Fixes #3843.

Fixes #3918

FUTURE_COPYBARA_INTEGRATE_REVIEW=#3918 from wmdietl:support-jdk21-ea 02b3d6f
PiperOrigin-RevId: 533140132
benkard pushed a commit to benkard/jgvariant that referenced this issue Jun 18, 2023
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [com.google.errorprone:error_prone_core](https://errorprone.info) ([source](https://github.com/google/error-prone)) |  | minor | `2.19.1` -> `2.20.0` |
| [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://github.com/google/error-prone)) | compile | minor | `2.19.1` -> `2.20.0` |

---

### Release Notes

<details>
<summary>google/error-prone</summary>

### [`v2.20.0`](https://github.com/google/error-prone/releases/tag/v2.20.0): Error Prone 2.20.0

[Compare Source](google/error-prone@v2.19.1...v2.20.0)

Changes:

-   This release is compatible with early-access builds of JDK 21.

New Checkers:

-   [`InlineTrivialConstant`](https://errorprone.info/bugpattern/InlineTrivialConstant)
-   [`UnnecessaryStringBuilder`](https://errorprone.info/bugpattern/UnnecessaryStringBuilder)
-   [`BanClassLoader`](https://errorprone.info/bugpattern/BanClassLoader)
-   [`DereferenceWithNullBranch`](https://errorprone.info/bugpattern/DereferenceWithNullBranch)
-   [`DoNotUseRuleChain`](https://errorprone.info/bugpattern/DoNotUseRuleChain)
-   [`LockOnNonEnclosingClassLiteral`](https://errorprone.info/bugpattern/LockOnNonEnclosingClassLiteral)
-   [`MissingRefasterAnnotation`](https://errorprone.info/bugpattern/MissingRefasterAnnotation)
-   [`NamedLikeContextualKeyword`](https://errorprone.info/bugpattern/NamedLikeContextualKeyword)
-   [`NonApiType`](https://errorprone.info/bugpattern/NonApiType)

Fixes issues: [#&#8203;2232](google/error-prone#2232), [#&#8203;2243](google/error-prone#2243), [#&#8203;2997](google/error-prone#2997), [#&#8203;3301](google/error-prone#3301), [#&#8203;3843](google/error-prone#3843), [#&#8203;3903](google/error-prone#3903), [#&#8203;3918](google/error-prone#3918), [#&#8203;3923](google/error-prone#3923), [#&#8203;3931](google/error-prone#3931), [#&#8203;3945](google/error-prone#3945), [#&#8203;3946](google/error-prone#3946)

**Full Changelog**: google/error-prone@v2.19.1...v2.20.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants