Enable varargs compilation warnings

See gh-21271
pull/21985/head
Andy Wilkinson 5 years ago
parent 9636350b0b
commit 753bea64c6

@ -157,7 +157,8 @@ class JavaConventions {
args.add("-parameters"); args.add("-parameters");
} }
if (JavaVersion.current() == JavaVersion.VERSION_1_8) { if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
args.addAll(Arrays.asList("-Werror", "-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:rawtypes")); args.addAll(Arrays.asList("-Werror", "-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:rawtypes",
"-Xlint:varargs"));
} }
}); });
} }

@ -49,6 +49,7 @@ public abstract class ManagementWebServerFactoryCustomizer<T extends Configurabl
private final Class<? extends WebServerFactoryCustomizer<?>>[] customizerClasses; private final Class<? extends WebServerFactoryCustomizer<?>>[] customizerClasses;
@SafeVarargs @SafeVarargs
@SuppressWarnings("varargs")
protected ManagementWebServerFactoryCustomizer(ListableBeanFactory beanFactory, protected ManagementWebServerFactoryCustomizer(ListableBeanFactory beanFactory,
Class<? extends WebServerFactoryCustomizer<?>>... customizerClasses) { Class<? extends WebServerFactoryCustomizer<?>>... customizerClasses) {
this.beanFactory = beanFactory; this.beanFactory = beanFactory;

@ -49,6 +49,7 @@ class NonUniqueSessionRepositoryFailureAnalyzerTests {
} }
@SafeVarargs @SafeVarargs
@SuppressWarnings("varargs")
private final Exception createFailure(Class<? extends SessionRepository<?>>... candidates) { private final Exception createFailure(Class<? extends SessionRepository<?>>... candidates) {
return new NonUniqueSessionRepositoryException(Arrays.asList(candidates)); return new NonUniqueSessionRepositoryException(Arrays.asList(candidates));
} }

@ -77,6 +77,7 @@ public class FilteredClassLoader extends URLClassLoader {
* name of a class or a resource name. * name of a class or a resource name.
*/ */
@SafeVarargs @SafeVarargs
@SuppressWarnings("varargs")
public FilteredClassLoader(Predicate<String>... filters) { public FilteredClassLoader(Predicate<String>... filters) {
this(Arrays.asList(filters), Arrays.asList(filters)); this(Arrays.asList(filters), Arrays.asList(filters));
} }

@ -77,6 +77,7 @@ public class ServletContextInitializerBeans extends AbstractCollection<ServletCo
private List<ServletContextInitializer> sortedList; private List<ServletContextInitializer> sortedList;
@SafeVarargs @SafeVarargs
@SuppressWarnings("varargs")
public ServletContextInitializerBeans(ListableBeanFactory beanFactory, public ServletContextInitializerBeans(ListableBeanFactory beanFactory,
Class<? extends ServletContextInitializer>... initializerTypes) { Class<? extends ServletContextInitializer>... initializerTypes) {
this.initializers = new LinkedMultiValueMap<>(); this.initializers = new LinkedMultiValueMap<>();

Loading…
Cancel
Save