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");
}
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;
@SafeVarargs
@SuppressWarnings("varargs")
protected ManagementWebServerFactoryCustomizer(ListableBeanFactory beanFactory,
Class<? extends WebServerFactoryCustomizer<?>>... customizerClasses) {
this.beanFactory = beanFactory;

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

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

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

Loading…
Cancel
Save