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

JDK15 - Illegal reflective access by com.google.errorprone.util.ErrorProneTokens$CommentSavingTokenizer #2271

Closed
jorisgeer opened this issue Apr 7, 2021 · 3 comments

Comments

@jorisgeer
Copy link

Description of the problem / feature request:

Compiling josm.openstreetmap.de with ant and JDK 15 shows :

[javac] WARNING: An illegal reflective access operation has occurred
[javac] WARNING: Illegal reflective access by com.google.errorprone.util.ErrorProneTokens$CommentSavingTokenizer (file:/../com.google.errorprone/error_prone_check_api/jars/error_prone_check_api-2.5.1.jar) to field com.sun.tools.javac.parser.JavaTokenizer.reader
[javac] WARNING: Please consider reporting this to the maintainers of com.google.errorprone.util.ErrorProneTokens$CommentSavingTokenizer
[javac] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[javac] WARNING: All illegal access operations will be denied in a future release

Feature requests: what underlying problem are you trying to solve with this feature?

Replace this line with your answer.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Compile with javac 15.0.2

What version of Error Prone are you using?

2.5.1

Have you found anything relevant by searching the web?

no

@cushon
Copy link
Collaborator

cushon commented Apr 8, 2021

Passing the --add-exports= and --add-opens= flags documented in http://errorprone.info/docs/installation will resolve the warning. (The flags are documented as applying to JDK 16 because it makes these diagnostics errors instead of warnings, so they become non-optional.)

@cushon cushon closed this as completed May 12, 2021
@davido
Copy link
Contributor

davido commented Jan 21, 2022

I am seeing this error also with Bazel 5.0.0. Should this be fixed on Bazel side?

INFO: From Building java/com/google/gerrit/httpd/libhttpd-class.jar (101 source files) and running annotation processors (AutoAnnotationProcessor, AutoValueProcessor, AutoOneOfProcessor):
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.errorprone.util.ErrorProneTokens$CommentSavingTokenizer (file:/b/f/w/external/remote_java_tools/java_tools/JavaBuilder_deploy.jar) to field com.sun.tools.javac.parser.JavaTokenizer.reader
WARNING: Please consider reporting this to the maintainers of com.google.errorprone.util.ErrorProneTokens$CommentSavingTokenizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@cushon
Copy link
Collaborator

cushon commented Jan 21, 2022

Should this be fixed on Bazel side?

Yes, I just mailed a change

bazel-io pushed a commit to bazelbuild/rules_java that referenced this issue Jan 21, 2022
…javac.parser`

Reported here: google/error-prone#2271 (comment)

PiperOrigin-RevId: 423272568
Change-Id: I1cc20d69c5502afb8e9769d036769fa0448f75f4
bazel-io pushed a commit to bazelbuild/bazel that referenced this issue Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants