Skip to content

Commit 61e4f3e

Browse files
committed
debugged for testJdk23
1 parent 0c577ae commit 61e4f3e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -472,22 +472,23 @@ public void checkTypeParameterNullnessForAssignability(
472472
List<Symbol.TypeVariableSymbol> typeParam = invokedMethodSymbol.getTypeParameters();
473473
List<Type> newTypeArgument = new ArrayList<>();
474474

475-
if (inferredTypes.containsKey(tree)) {
476-
Map<Type, Type> genericNullness = inferredTypes.get(tree);
475+
if (inferredTypes.containsKey(rhsTree)) {
476+
Map<Type, Type> genericNullness = inferredTypes.get(rhsTree);
477477
for (int i = 0; i < typeParam.size(); i++) {
478478
if (genericNullness.containsKey(typeParam.get(i).type)) {
479479
var pType = typeParam.get(i).type;
480480
newTypeArgument.add(genericNullness.get(pType)); // replace type to inferred types
481481
}
482482
}
483+
484+
Type.ClassType classType = (Type.ClassType) rhsType;
485+
// create a new Type.ClassType that has inferred types
486+
rhsType =
487+
new Type.ClassType(
488+
classType.getEnclosingType(),
489+
com.sun.tools.javac.util.List.from(newTypeArgument),
490+
classType.tsym);
483491
}
484-
Type.ClassType classType = (Type.ClassType) rhsType;
485-
// create a new Type.ClassType that has inferred types
486-
rhsType =
487-
new Type.ClassType(
488-
classType.getEnclosingType(),
489-
com.sun.tools.javac.util.List.from(newTypeArgument),
490-
classType.tsym);
491492
}
492493
}
493494

0 commit comments

Comments
 (0)