-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hack NullAway LibraryModels generator MVP POC #2
Comments
FWIW, the Checker Framework groups (EISOP + Typetools) are trying to move off JavaParser IIUC, as they've had issues:
Their likely replacement is https://github.com/plume-lib/javac-parse/blob/main/src/main/java/org/plumelib/javacparse/JavacParse.java, which contains the same basic boilerplate as various similar tools use (example). As for reflection: If you can actually compile the annotated Java sources, then that could work fine AFAIK. (Maybe bugs around type annotations are more likely for reflection than for build tools, but I don't know. I at least doubt you'd have significant issues for annotations on "root" locations (e.g., fields and method return types, as opposed to type arguments inside those).) I think we ended up with our approach in part because we were interested in annotations for the JDK, which might be trickier to build? I don't actually remember the details of that discussion, if even I heard most of them in the first place. (I do think that trying to do the job with only a "parser" is a bit sketchy: You really want the deps of the classes to be available, I think. But apparently they mostly get away with it.) |
A couple of thoughts / questions.
|
The goal of this issue would be to explore hacking a converter from annotated Java sources to a NullAway LibraryModels generator MVP POC.
Use case / application would be for / driven by enola-dev/enola#845 (and possibly also using NullAway e.g. for my https://github.com/vorburger/ch.vorburger.exec or https://github.com/vorburger/ch.vorburger.fswatch or https://github.com/MariaDB4j/MariaDB4j).
Approach/steps planned would be to:
.java
, in a TBD https://github.com/lastnpe/jspecify-null-external-annotations-augmentshttps://github.com/javaparser/javaparser, and/or it's apparent (?) fork https://github.com/eisop/stubparser, used by (?) https://github.com/typetools/annotation-tools may be of interest - although I don't yet fully understand if any of that is even needed... what's wrong with plain simple Java reflection?!
Re. uber/NullAway#1024
/CC @cpovirk FYI
The text was updated successfully, but these errors were encountered: