-
Notifications
You must be signed in to change notification settings - Fork 957
Provide guidance for additional null check #8173
Copy link
Copy link
Open
Description
We need to get consistent about whether or not we do this. We rely on
javax.annotation.Nullableannotation, the assumption that params and returns are non-null unless otherwise specified, leveraging thenet.ltgt.nullawayerror prone plugin to validate at build time. Of course, at runtime there is no guarantee that callers adhere to these annotations, and so we have code like this which checks for null despite the params being non-null according to the annotations.We need to be consistent about:
- When and why do we add additional null checks
- Where do we do this (i.e. in interface default methods or in the actual implementation)
- What is the behavior when the null annotation is violated (throw or noop)
Let's hold off here until we get some repo level guidance on this. ConfigProperties, the env var / sys property analog of
DeclarativeConfigProperties, has the exact same method and does not do this null check.
Originally posted by @jack-berg in #8079
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels