Decouple synthetic nullness annotations from VisitorState
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Read GenericsChecks.getSyntheticNullableAnnotType and getSyntheticNonNullAnnotType, RestoreNullnessAnnotationsVisitor, and the discussion on PR #1972. Trace captured-type annotation recovery to separate semantic restoration from obtaining an annotation object, preserving inferred capture nullability, explicit type-variable annotations, intersection bounds, and compiler-owned type isolation. Validate any cleanup with ordinary diagnostic tests for wildcard captures and intersection inference, including the generic call inside the constructor lambda from #1972.
Written by the indexing model from the issue text.
Description
Note that this issue has been framed with agentic help (GPT 6.1).
Follow-up requested in https://github.com/uber/NullAway/pull/1972#discussion_r4368635862.
GenericsChecks.getSyntheticNullableAnnotType and getSyntheticNonNullAnnotType currently require VisitorState to access javac Names and Symtab. RestoreNullnessAnnotationsVisitor does not have a VisitorState, and its captured-type handling retrieves and reuses a synthetic annotation from another type through getDirectSyntheticNullnessAnnotation.
Investigate whether synthetic annotation creation can depend on a narrower compiler context, or whether annotation types can be supplied explicitly to restoration, so that the workaround and annotation-recovery helper can be simplified. Confirm which parts of the helper are required for semantic restoration rather than merely for obtaining an annotation object before removing anything.
Preserve the distinction between inferred capture nullability and explicit type-variable use annotations, structural handling of intersection bounds, and isolation of compiler-owned mutable types. Validate any cleanup with ordinary NullAway diagnostic tests for wildcard captures and intersection inference, including the separately inferred generic call inside a constructor lambda from #1972.
This is a follow-up investigation, not a proposed change to library-model precedence or a claim that all existing helper branches are redundant.
- Dominant language
- Java
- Stars
- 4.1k
- Forks
- 379
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 106
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from uber/NullAway
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
uber/NullAway#2145 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
uber/NullAway#2058 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
uber/NullAway#1899 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
uber/NullAway#2160 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
johanhaleby/occurrent#1505 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
FasterXML/jackson-databind#6443 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
finos/fluxnova-bpm-platform#387 ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100