Skip to content

Commit 5476215

Browse files
committed
extract local
1 parent 6f6aefe commit 5476215

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,11 @@ private static void reportInvalidOverridingMethodParamTypeError(
415415
*/
416416
public static void checkTypeParameterNullnessForAssignability(
417417
Tree tree, NullAway analysis, VisitorState state) {
418-
if (!analysis.getConfig().isJSpecifyMode()) {
418+
Config config = analysis.getConfig();
419+
if (!config.isJSpecifyMode()) {
419420
return;
420421
}
421-
Type lhsType = getTreeType(tree, analysis.getConfig());
422+
Type lhsType = getTreeType(tree, config);
422423
Tree rhsTree;
423424
if (tree instanceof VariableTree) {
424425
VariableTree varTree = (VariableTree) tree;
@@ -432,11 +433,10 @@ public static void checkTypeParameterNullnessForAssignability(
432433
if (rhsTree == null || rhsTree.getKind().equals(Tree.Kind.NULL_LITERAL)) {
433434
return;
434435
}
435-
Type rhsType = getTreeType(rhsTree, analysis.getConfig());
436+
Type rhsType = getTreeType(rhsTree, config);
436437

437438
if (lhsType != null && rhsType != null) {
438-
boolean isAssignmentValid =
439-
subtypeParameterNullability(lhsType, rhsType, state, analysis.getConfig());
439+
boolean isAssignmentValid = subtypeParameterNullability(lhsType, rhsType, state, config);
440440
if (!isAssignmentValid) {
441441
reportInvalidAssignmentInstantiationError(tree, lhsType, rhsType, state, analysis);
442442
}

0 commit comments

Comments
 (0)