Java 1.7 varargs function reported as unchecked warning
问题 We use some varargs functions and as we move to java 1.7 we are getting a strange unchecked warning. Function add in interface ICache public interface ICache<O> { void add(Object source, O... objects); } in an interface reports the error. ICache.java:18: warning: [unchecked] Possible heap pollution from parameterized vararg type O void add(Object source, O... objects); where O is a type-variable: O extends Object declared in interface ICache 1 warning O extends Object, as its generic cache