-
Notifications
You must be signed in to change notification settings - Fork 1
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
Further Support Null Analysis #47
base: main
Are you sure you want to change the base?
Conversation
Alright, we're now good with both checker framework and nullaway. |
Yep, Just Works™. Very cool, thank you. :) |
avaje-record-builder-core/src/main/java/io/avaje/recordbuilder/internal/Templates.java
Outdated
Show resolved
Hide resolved
avaje-record-builder/src/main/java/io/avaje/recordbuilder/RecordBuilder.java
Show resolved
Hide resolved
So, I'm thinking this maybe could work better / more accurately in that with the current That is, if code is using jspecify then there is That is, currently there isn't code in the annotation processor to traverse up the enclosed types (class -> package -> module) looking for a I'm pondering if it would be better if the enforceNullSafety was removed completely and instead if a record component isn't explicitly defined as NonNull or Nullable then:
Nb: Packages are not enclosed by "parent" packages.
|
why not both? |
We can probably also try to annotation process those nullmark annotations in any case we can add that as a fast followup, this PR is getting pretty big. |
Yeah, that sounds right. Checker Framework presently supports neither annotation and NullAway has only experimental support for them (and the default happens to be acceptable for my use cases) so I have not experimented with those combinations.
I suppose because |
I'm thinking more along the lines of somebody who doesn't use static null analysis and wants the builders to enforce non-null at runtime anyway. this option would be useful for them. |
hmm, yeah wasn't that hard to add |
nullableAnnotation
is set)@NonNull
is detected on a component, the generatedbuild
method will validate that the value isn't null@Nullable
)@NullMarked
and@NullUnmarked
builderInterfaces
propertyResolves #43 (At least for the checker framework)
also has changes from #45