Nullable annotations are mostly meaningless
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.4k
- Forks
- 627
- Avg merge
- 3d 15m
- Merged PRs (30d)
- 20
Description
To not run into compatibility problems every single field in a proto ends up being optional, ergo annotated @Nullable. Even if the person writing the proto knows a field cannot be null, theres no way to communicate that and generate Messages with appropriate nullability annotations. The nullable annotations end up being pretty useless because theres no way to know if a field is being passed as null, or not being passed at all and turned into null. Ideally when lint warns me about a field being nullable I know that means it could be passed to me as null and I need to do null logic, but right now I just ignore most warnings because the value will never actually be null.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by locating the proto-to-Message generation path and the code that applies @Nullable annotations, then define how absent fields differ from explicitly null fields and what generated nullability should communicate; done means the semantics are specified and covered by generation tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100