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:
@@ -93,7 +93,8 @@ public abstract class AbstractIntSet extends AbstractSet<Integer>
|
|||||||
@Override // from AbstractSet<Integer>
|
@Override // from AbstractSet<Integer>
|
||||||
public boolean contains (Object o)
|
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>
|
@Override // from AbstractSet<Integer>
|
||||||
@@ -105,7 +106,8 @@ public abstract class AbstractIntSet extends AbstractSet<Integer>
|
|||||||
@Override // from AbstractSet<Integer>
|
@Override // from AbstractSet<Integer>
|
||||||
public boolean remove (Object o)
|
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>
|
@Override // from AbstractSet<Integer>
|
||||||
|
|||||||
Reference in New Issue
Block a user