Actually, let's go ahead and NPE or CCE in remove() and contains() if

the specified object is not an Integer. We're allowed to do that
per the Collection interface spec, and ArrayIntSet previously had
that behavior (but the IntMap keySets did not...).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2651 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray.j.greenwell
2009-11-24 20:34:44 +00:00
parent e8e6c95565
commit bdda88cd45
@@ -93,7 +93,8 @@ public abstract class AbstractIntSet extends AbstractSet<Integer>
@Override // from AbstractSet<Integer>
public boolean contains (Object o)
{
return (o instanceof Integer) && contains(((Integer)o).intValue());
// let's go ahead and NPE or CCE if an Integer is not specified
return /* (o instanceof Integer) && */ contains(((Integer)o).intValue());
}
@Override // from AbstractSet<Integer>
@@ -105,7 +106,8 @@ public abstract class AbstractIntSet extends AbstractSet<Integer>
@Override // from AbstractSet<Integer>
public boolean remove (Object o)
{
return (o instanceof Integer) && remove(((Integer)o).intValue());
// let's go ahead and NPE or CCE if an Integer is not specified
return /* (o instanceof Integer) && */ remove(((Integer)o).intValue());
}
@Override // from AbstractSet<Integer>