提交 42b11b0d authored 作者: Thomas Mueller's avatar Thomas Mueller

Avoid "warning: [unchecked] Possible heap pollution from parameterized vararg…

Avoid "warning: [unchecked] Possible heap pollution from parameterized vararg type" (should use @SafeVarargs, but Java 6 doesn't support that yet)
上级 7db14503
...@@ -112,6 +112,7 @@ public final class ImmutableArray<K> implements Iterable<K> { ...@@ -112,6 +112,7 @@ public final class ImmutableArray<K> implements Iterable<K> {
* @param array the data * @param array the data
* @return the new immutable array * @return the new immutable array
*/ */
@SuppressWarnings("unchecked")
public static <K> ImmutableArray<K> create(K... array) { public static <K> ImmutableArray<K> create(K... array) {
return new ImmutableArray<K>(array); return new ImmutableArray<K>(array);
} }
......
...@@ -151,6 +151,7 @@ public final class ImmutableArray2<K> implements Iterable<K> { ...@@ -151,6 +151,7 @@ public final class ImmutableArray2<K> implements Iterable<K> {
* @param array the data * @param array the data
* @return the new immutable array * @return the new immutable array
*/ */
@SuppressWarnings("unchecked")
public static <K> ImmutableArray2<K> create(K... array) { public static <K> ImmutableArray2<K> create(K... array) {
return new ImmutableArray2<K>(array, array.length); return new ImmutableArray2<K>(array, array.length);
} }
......
...@@ -84,6 +84,7 @@ public abstract class ImmutableArray3<K> implements Iterable<K> { ...@@ -84,6 +84,7 @@ public abstract class ImmutableArray3<K> implements Iterable<K> {
* @param array the data * @param array the data
* @return the new immutable array * @return the new immutable array
*/ */
@SuppressWarnings("unchecked")
public static <K> ImmutableArray3<K> create(K... array) { public static <K> ImmutableArray3<K> create(K... array) {
return new Plain<K>(array); return new Plain<K>(array);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论