Add support for Annotation Processors in the Javac Extension#3686
Add support for Annotation Processors in the Javac Extension#3686PiIsRational wants to merge 21 commits intoKeYProject:mainfrom
Conversation
key.ui/src/main/java/de/uka/ilkd/key/gui/plugins/javac/JavaCompilerCheckFacade.java
Outdated
Show resolved
Hide resolved
…figuration" This reverts commit 74af1d7.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3686 +/- ##
============================================
+ Coverage 50.48% 50.85% +0.37%
+ Complexity 16158 15277 -881
============================================
Files 1620 1537 -83
Lines 92011 89640 -2371
Branches 14705 14134 -571
============================================
- Hits 46455 45590 -865
+ Misses 40292 38994 -1298
+ Partials 5264 5056 -208 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
One solution to the
|
Externalize Javac into separate Java process for setting JMS directives
key.ui/src/main/java/de/uka/ilkd/key/gui/plugins/javac/JavaCompilerCheckFacade.java
Outdated
Show resolved
Hide resolved
WolframPfeifer
left a comment
There was a problem hiding this comment.
Thanks for this PR, which will allow running Checker Framework checkers (e.g. for Nullness of Ownership) from the KeY GUI directly.
Also, thanks to @wadoon for the initial draft of the external checker, and @PiIsRational for polishing.
I have a few minor complaints about the use of var. When these are fixed, the PR would be ready from my point of view. Also, there is code smell in the unit test (check without assert), but we could also keep it like that.
key.ui/src/main/java/de/uka/ilkd/key/gui/plugins/javac/JavaCompilerCheckFacade.java
Outdated
Show resolved
Hide resolved
key.ui/src/main/java/de/uka/ilkd/key/gui/plugins/javac/JavaCompilerCheckFacade.java
Outdated
Show resolved
Hide resolved
key.ui/src/main/java/de/uka/ilkd/key/gui/plugins/javac/JavaCompilerCheckFacade.java
Outdated
Show resolved
Hide resolved
key.ui/src/test/java/de/uka/ilkd/key/gui/plugins/javac/JavaCompilerCheckFacadeTest.java
Show resolved
Hide resolved
| * @return future providing the list of diagnostics | ||
| */ | ||
| public static @NonNull CompletableFuture<List<PositionedIssueString>> check( | ||
| ProblemInitializer.ProblemInitializerListener listener, |
There was a problem hiding this comment.
Why is the listener needed here? It seems to only be used to generate an error message for a corner case (a system without a Java compiler). Would it make sense to therefore remove it?
Changes
Extended the Javac Extension to be able to load annotation processors, while the java code is getting checked
in KeY. This includes creating settings for the Javac Extension, to be able to set the checkers.
Also, the there are changes to the run step of the gradle script
to add (add-export and add-opens) directives to the java runtime such that annotations processors can access the internal java compiler data structures.
This is required to be done by hand when using KeY as a jar and would require the following (or similar) command:
java \ --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \ --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \ -jar key-2.12.4-dev-exe.jarType of pull request
Ensuring quality
Additional information and contact(s)
@WolframPfeifer is involved in this pull request.
The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.