typetools / typetools/checker-framework
Illegal reflective access warning (Using Java 11)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
Using the eisop fork of CF:
export JAVA_HOME=$JAVA_11_HOME
javac -processorpath $CHECKERFRAMEWORK/checker/dist/checker.jar -cp $CHECKERFRAMEWORK/checker/dist/checker-qual.jar -Anocheckjdk -processor org.checkerframework.checker.nullness.NullnessChecker $CHECKERFRAMEWORK/checker/tests/nullness/KeyFors.java
Warning:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.checkerframework.javacutil.Resolver (file:/Users/smillst/jsr308/checker-framework/checker/dist/checker.jar) to method com.sun.tools.javac.comp.Resolve.findMethod(com.sun.tools.javac.comp.Env,com.sun.tools.javac.code.Type,com.sun.tools.javac.util.Name,com.sun.tools.javac.util.List,com.sun.tools.javac.util.List,boolean,boolean)
WARNING: Please consider reporting this to the maintainers of org.checkerframework.javacutil.Resolver
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
org.checkerframework.javacutil.Resolver is used by the FlowExpressionParser to access the element corresponding to FlowExpressions.
The warning can be suppressed by adding -J--add-opens options:
javac -processorpath $CHECKERFRAMEWORK/checker/dist/checker.jar -cp $CHECKERFRAMEWORK/checker/dist/checker-qual.jar -Anocheckjdk -processor org.checkerframework.checker.nullness.NullnessChecker -Anocheckjdk $CHECKERFRAMEWORK/checker/tests/nullness/KeyFors.java \
-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Java 11 warning with the javac command and tests/nullness/KeyFors.java. Read org.checkerframework.javacutil.Resolver and its use by FlowExpressionParser, which the issue identifies as the reflective-access path. Done means the command no longer emits the illegal reflective access warning without requiring the added -J--add-opens option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100