diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java index 24b99a3de8..d4b1c81eb2 100644 --- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java +++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java @@ -1854,8 +1854,7 @@ private Description handleInvocation( GenericsChecks.compareGenericTypeParameterNullabilityForCall( formalParams, actualParams, varArgsMethod, this, state); if (!methodSymbol.getTypeParameters().isEmpty()) { - GenericsChecks.checkInstantiationForGenericMethodCalls( - tree, state, this, config, handler); + GenericsChecks.checkGenericMethodCallTypeArguments(tree, state, this, config, handler); } } } diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java index 7c27edd867..86337f2bd9 100644 --- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java +++ b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java @@ -149,8 +149,8 @@ private static boolean[] getTypeParamsWithNullableUpperBound( } /** - * Checks instantiated generic arguments of generic method calls. {@code @Nullable} types can only - * be used for type variables that have a {@code @Nullable} upper bound. + * Checks validity of type arguments at a generic method call. A {@code @Nullable} type argument + * can only be used for a type variable that has a {@code @Nullable} upper bound. * * @param tree the tree representing the instantiated type * @param state visitor state @@ -158,7 +158,7 @@ private static boolean[] getTypeParamsWithNullableUpperBound( * @param config the analysis config * @param handler the handler instance */ - public static void checkInstantiationForGenericMethodCalls( + public static void checkGenericMethodCallTypeArguments( Tree tree, VisitorState state, NullAway analysis, Config config, Handler handler) { List typeArguments = ((MethodInvocationTree) tree).getTypeArguments(); if (typeArguments.isEmpty()) {