I have a function. I like my function. It makes lists and it makes me happy. My IDE gives me a warning about my function though, talking about potential heap pollution. I can add an annotation to suppress this warning, but I want to make sure I'm not suppressing a legitimate concern. Can anyone confirm whether the function below is safe/unsafe?
public static <T> List<T> listIt(T... t) {
List<T> lzt = new ArrayList<T>();
for (T i: t)
lzt.add(i);
return lzt;
}