@@ -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