Fix possible ClassCastException, because DSet.contains(E entry)

will type-erase to DSet.Entry. Ensure objects tested for containment
in our Set view implement that.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6128 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2010-08-11 20:34:27 +00:00
parent 891ca8db44
commit 696f77beb5
@@ -272,6 +272,9 @@ public class DSet<E extends DSet.Entry>
throw new UnsupportedOperationException();
}
@Override public boolean contains (Object o) {
if (!(o instanceof DSet.Entry)) {
return false;
}
@SuppressWarnings("unchecked") E elem = (E)o;
return DSet.this.contains(elem);
}