Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a1e4bb8
WIP
msridhar Jan 29, 2026
22fb655
test case
msridhar Feb 6, 2026
e86b344
tweak test
msridhar Feb 6, 2026
81f952c
better tests
msridhar Feb 6, 2026
03ce931
WIP
msridhar Feb 6, 2026
dfba3e5
docs
msridhar Feb 6, 2026
fdf01ee
WIP
msridhar Feb 6, 2026
4446516
simplify
msridhar Feb 6, 2026
dc3a227
more
msridhar Feb 6, 2026
471701d
simplify
msridhar Feb 6, 2026
aea98ae
simplify
msridhar Feb 6, 2026
0e2df18
reuse helper method
msridhar Feb 6, 2026
e607850
bug fix
msridhar Feb 6, 2026
d1636f7
fix nested constructors
msridhar Feb 7, 2026
c6c1e9a
fix diagnostic message
msridhar Feb 7, 2026
68ad56d
simplify
msridhar Feb 7, 2026
02d32b6
small fix
msridhar Feb 8, 2026
ec32f89
another fix
msridhar Feb 8, 2026
bae860f
Merge branch 'master' into issue-1451
msridhar Feb 8, 2026
e1d8386
Merge branch 'master' into issue-1451
msridhar Feb 14, 2026
89bb268
failing test
msridhar Feb 14, 2026
36ac60c
test fix
msridhar Feb 14, 2026
65fc519
tweaks
msridhar Feb 14, 2026
2454efd
docs
msridhar Feb 15, 2026
df8f89e
add issue links
msridhar Feb 15, 2026
82e633e
remove unnecessary code
msridhar Feb 15, 2026
319f453
more coderabbit comments
msridhar Feb 15, 2026
1374e89
Merge branch 'master' into issue-1451
msridhar Feb 17, 2026
4babffe
test of Void without @Nullable
msridhar Feb 18, 2026
78501f2
extract helper to check for raw types and use for NewClassTrees
msridhar Feb 18, 2026
2c50426
add tracking issue
msridhar Feb 18, 2026
95ee81d
add another link to issue
msridhar Feb 18, 2026
39898d7
tweak comment
msridhar Feb 18, 2026
bfd95f7
get rid of withPathToSubtree
msridhar Feb 19, 2026
d50bf7b
WIP
msridhar Feb 19, 2026
bc76012
fixes
msridhar Feb 19, 2026
2883e5a
add case and TODO for ConditionalExpressionTree
msridhar Feb 19, 2026
e321bbc
Merge branch 'master' into issue-1451
msridhar Feb 21, 2026
dc9d2dc
try throwing
msridhar Feb 21, 2026
829490a
don't throw, but track in an issue
msridhar Feb 21, 2026
caa54dd
add javadoc
msridhar Feb 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
get rid of withPathToSubtree
  • Loading branch information
msridhar committed Feb 19, 2026
commit bfd95f72191f15dbe7908a0912198b2273607526
Original file line number Diff line number Diff line change
Expand Up @@ -652,20 +652,6 @@ private void reportInvalidOverridingMethodParamTypeError(
}.scan(rootPath, null);
}

/**
* Creates a state whose path points to {@code subtree}, when that subtree is reachable.
*
* @param state the original state with a path to some subtree of the AST
* @param subtree the subtree to find within the original state's path
* @return a state with the same information as the original, but with a path to {@code subtree}
* if it is reachable from the original state's path, or the original state if {@code subtree}
* is not reachable
*/
private static VisitorState withPathToSubtree(VisitorState state, Tree subtree) {
TreePath subtreePath = findPathToSubtree(state.getPath(), subtree);
return subtreePath == null ? state : state.withPath(subtreePath);
}

/**
* Returns true when javac inferred class type arguments for a constructor call, i.e. there are
* instantiated type arguments at the type level, but no explicit non-diamond source type args.
Expand Down Expand Up @@ -767,7 +753,7 @@ public void checkTypeParameterNullnessForAssignability(Tree tree, VisitorState s
&& isAssignmentToField(tree)) {
maybeStoreLambdaTypeFromTarget(lambdaExpressionTree, lhsType);
}
Type rhsType = getTreeType(rhsTree, withPathToSubtree(state, rhsTree));
Type rhsType = getTreeType(rhsTree, state);
if (rhsType != null) {
if (isGenericCallNeedingInference(rhsTree)) {
rhsType =
Expand Down Expand Up @@ -1490,7 +1476,7 @@ public void checkTypeParameterNullnessForFunctionReturnType(
// bail out of any checking involving raw types for now
return;
}
Type returnExpressionType = getTreeType(retExpr, withPathToSubtree(state, retExpr));
Type returnExpressionType = getTreeType(retExpr, state);
if (returnExpressionType != null) {
if (isGenericCallNeedingInference(retExpr)) {
returnExpressionType =
Expand Down Expand Up @@ -1685,8 +1671,7 @@ public void compareGenericTypeParameterNullabilityForCall(
if (inferredPolyType != null) {
actualParameterType = inferredPolyType;
} else {
actualParameterType =
getTreeType(currentActualParam, withPathToSubtree(state, currentActualParam));
actualParameterType = getTreeType(currentActualParam, state);
}
if (actualParameterType != null) {
if (isGenericCallNeedingInference(currentActualParam)) {
Expand Down Expand Up @@ -2207,14 +2192,14 @@ public Nullness getGenericParameterNullnessAtInvocation(
false,
calledFromDataflow);
} else {
enclosingType = getTreeType(receiver, withPathToSubtree(state, receiver));
enclosingType = getTreeType(receiver, state);
}
}
} else {
Verify.verify(tree instanceof NewClassTree);
// for a constructor invocation, the type from the invocation itself is the "enclosing type"
// for the purposes of determining type arguments
enclosingType = getTreeType(tree, withPathToSubtree(state, tree));
enclosingType = getTreeType(tree, state);
}
return enclosingType;
}
Expand Down