Browse Source

Suppress varargs warnings when compiling tests w/ Gradle

pull/890/head
Sam Brannen 9 years ago
parent
commit
c2bc2b27ea
  1. 2
      build.gradle
  2. 7
      spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java

2
build.gradle

@ -100,7 +100,7 @@ configure(allprojects) { project -> @@ -100,7 +100,7 @@ configure(allprojects) { project ->
]
compileTestJava.options*.compilerArgs = [
"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
"-Xlint:serial", "-Xlint:-varargs", "-Xlint:cast", "-Xlint:classfile",
"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",

7
spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java

@ -644,6 +644,13 @@ public class AnnotatedElementUtilsTests { @@ -644,6 +644,13 @@ public class AnnotatedElementUtilsTests {
}
@SafeVarargs
// The following "varargs" suppression is necessary for javac from OpenJDK
// (1.8.0_60-b27); however, Eclipse warns that it's unnecessary. See the following
// Eclipse issues for details.
//
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=344783
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=349669#c10
// @SuppressWarnings("varargs")
private static <T> T[] asArray(T... arr) {
return arr;
}

Loading…
Cancel
Save