Prototype implementation of javac plugin to serialize nullness annotations#1225
Merged
Prototype implementation of javac plugin to serialize nullness annotations#1225
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1225 +/- ##
============================================
+ Coverage 88.36% 88.44% +0.07%
- Complexity 2366 2369 +3
============================================
Files 89 90 +1
Lines 7693 7772 +79
Branches 1540 1552 +12
============================================
+ Hits 6798 6874 +76
- Misses 450 452 +2
- Partials 445 446 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@cpovirk would be interested to get your thoughts on this approach |
|
That all sounds reasonable to me. I don't want to obligate @cushon or @eamonnmcmanus to get deep into this, but if either of them wants to run screaming into the chapel to object, now would be the time :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a new approach to serializing the annotations from https://github.com/jspecify/jdk for use with NullAway. The idea is we build that JDK with this plugin, which will dump out all the discovered annotation info into JSON files. Then, we write some code to take all those JSON files and convert them to astubx for NullAway. I went with JSON instead of directly serializing astubx to iterate more quickly. I have tested with jspecify/jdk and confirmed I can inject this plugin into the build and the output JSON files get created. I haven't started on the code to convert the JSON to astubx yet.
Of course there is much left to do, but I wanted to get this initial implementation up for review rather than dropping a huge PR at the end (and also to enable others to help out). We previously thought about getting out the JDK annotations by parsing the source files (and wrote some code to do so), but I think this approach will be more robust, as in the javac plugin we don't need worry about parsing of recent language features and all symbols are just resolved.
Related to #950 (which probably needs to be updated if we go forward with this approach)