src/share/classes/sun/swing/BakedArrayList.java

Print this page

        

*** 42,62 **** * only ever compare a BakedArrayList to another BakedArrayList. * * @author Scott Violet */ @SuppressWarnings("serial") // JDK-implementation class ! public class BakedArrayList extends ArrayList<Object> { /** * The cached hashCode. */ private int _hashCode; public BakedArrayList(int size) { super(size); } ! public BakedArrayList(java.util.List<?> data) { this(data.size()); for (int counter = 0, max = data.size(); counter < max; counter++){ add(data.get(counter)); } cacheHashCode(); --- 42,62 ---- * only ever compare a BakedArrayList to another BakedArrayList. * * @author Scott Violet */ @SuppressWarnings("serial") // JDK-implementation class ! public class BakedArrayList<E> extends ArrayList<E> { /** * The cached hashCode. */ private int _hashCode; public BakedArrayList(int size) { super(size); } ! public BakedArrayList(java.util.List<? extends E> data) { this(data.size()); for (int counter = 0, max = data.size(); counter < max; counter++){ add(data.get(counter)); } cacheHashCode();
*** 76,86 **** public int hashCode() { return _hashCode; } public boolean equals(Object o) { ! BakedArrayList list = (BakedArrayList)o; int size = size(); if (list.size() != size) { return false; } --- 76,87 ---- public int hashCode() { return _hashCode; } public boolean equals(Object o) { ! @SuppressWarnings("unchecked") ! BakedArrayList<E> list = (BakedArrayList)o; int size = size(); if (list.size() != size) { return false; }