to be JDK6-buildable, replace SafeVarargs with SuppressWarnings

This commit is contained in:
Reinier Zwitserloot committed 2023-01-19 22:55:03 +01:00
1 parent e02d0c64cf
commit 86029538ee
1 file changed
+2 -1
@@ -57,7 +57,8 @@ public final class LombokImmutableList<T> implements Iterable<T> {
return new LombokImmutableList<T>(new Object[] {a, b, c, d, e});
}
@SafeVarargs public static <T> LombokImmutableList<T> of(T a, T b, T c, T d, T e, T f, T... g) {
@SuppressWarnings({"all", "unchecked"})
public static <T> LombokImmutableList<T> of(T a, T b, T c, T d, T e, T f, T... g) {
Object[] rest = g == null ? new Object[] {null} : g;
Object[] val = new Object[rest.length + 6];
System.arraycopy(rest, 0, val, 6, rest.length);