Fix 'Potential heap pollution via vargs parameter' warnings
Most existing sites are safe. The implementating method only scans the array and does not retain it beyond the method invocation. In the questionable cases use ImmutableList instead of a varargs array. Change-Id: Ic2d0c1c1801a68ec58b642552e97e2d193b40a98
This commit is contained in:
@@ -50,6 +50,7 @@ public abstract class Predicate<T> {
|
||||
}
|
||||
|
||||
/** Combine the passed predicates into a single AND node. */
|
||||
@SafeVarargs
|
||||
public static <T> Predicate<T> and(final Predicate<T>... that) {
|
||||
if (that.length == 1) {
|
||||
return that[0];
|
||||
@@ -67,6 +68,7 @@ public abstract class Predicate<T> {
|
||||
}
|
||||
|
||||
/** Combine the passed predicates into a single OR node. */
|
||||
@SafeVarargs
|
||||
public static <T> Predicate<T> or(final Predicate<T>... that) {
|
||||
if (that.length == 1) {
|
||||
return that[0];
|
||||
|
Reference in New Issue
Block a user