-
Notifications
You must be signed in to change notification settings - Fork 134
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
Fix jdk17 incompatibility of ClassInitializationDeadlock #1936
Conversation
Generate changelog in
|
|
||
/** | ||
* A compatibility wrapper around {@link com.sun.tools.javac.util.Filter}. | ||
* Adapted from {@link com.google.errorprone.util.ErrorProneScope} with additional methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a link to ErrorProneScope.java
upstream at the commit we borrowed from and note the license (Apache 2.0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm pending comment 👍
Released 4.29.0 |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.29.0 | Type | Description | Link | | ---- | ----------- | ---- | | Fix | Fix jdk17 incompatibility of ClassInitializationDeadlock | palantir/gradle-baseline#1936 | To enable or disable this check, please contact the maintainers of Excavator.
Add a compatibility helper method for `getSymbols(Predicate<Symbol>, LookupKind)`. **Context:** In [gradle-baseline](https://github.com/palantir/gradle-baseline#baseline-error-prone-checks), we maintain our own set of error-prone rules and ran into similar JDK 17 compatibility problems as mentioned in #2330. However for our custom rules, we also need a compatibility helper for `getSymbols(Predicate, LookupKind)`. For now, we work around this by copying parts of the `ErrorProneScope` class (([PR](palantir/gradle-baseline#1936))) but ideally we could reuse the existing helper and wouldn't have to maintain our own fork of this class. Fixes #2629 COPYBARA_INTEGRATE_REVIEW=#2629 from fawind:fw/get-symbols-lookup-kind e843406 PiperOrigin-RevId: 404111704
google/error-prone#2629 got merged so with the next error-prone release we should be good to remove our fork of |
Before this PR
When compiling with JDK 17 you get the following error:
This is due to breaking changes to the
com.sun.tools.javac.util.Filter
API.Upstream error-prone also ran into this problem (issue, PR). They fixed this by adding a "compatibility wrapper" around
Filter
:ErrorProneScope.java
. Unfortunately, the error-prone compatibility wrapper only provides the methodgetSymbols(Predicate<Symbol>)
but not the methodgetSymbols(Predicate<Symbol>, LookupKind)
which is the one we need.After this PR
Closes #1926
ErrorProneScope
, adding the missing method.==COMMIT_MSG==
Fix jdk17 incompatibility of ClassInitializationDeadlock
==COMMIT_MSG==
Possible downsides?
We don't have testing infra for jdk17 yet, so the jdk17 codepath is untested (although I tested in a local project).