Skip to content

Commit c2bc2b2

Browse files
committed
Suppress varargs warnings when compiling tests w/ Gradle
1 parent 1c3a668 commit c2bc2b2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ configure(allprojects) { project ->
100100
]
101101

102102
compileTestJava.options*.compilerArgs = [
103-
"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
103+
"-Xlint:serial", "-Xlint:-varargs", "-Xlint:cast", "-Xlint:classfile",
104104
"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
105105
"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
106106
"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,13 @@ private Set<String> names(Class<?>... classes) {
644644
}
645645

646646
@SafeVarargs
647+
// The following "varargs" suppression is necessary for javac from OpenJDK
648+
// (1.8.0_60-b27); however, Eclipse warns that it's unnecessary. See the following
649+
// Eclipse issues for details.
650+
//
651+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=344783
652+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=349669#c10
653+
// @SuppressWarnings("varargs")
647654
private static <T> T[] asArray(T... arr) {
648655
return arr;
649656
}

0 commit comments

Comments
 (0)