📅  最后修改于: 2022-03-11 14:52:42.751000             🧑  作者: Mango
Collection c = new ArrayList();
Integer obj = new Integer(1);
c.add(obj);
// this would trigger the rule (and throw a ClassCastException if executed)
Integer[] a = (Integer [])c.toArray();
// this is fine and will not trigger the rule
Integer[] b = (Integer [])c.toArray(new Integer[c.size()]);