Skip to content
Permalink
Browse files
Collection methods with no implementation throw UnsupportedOperationE…
…xception rather than doing nothing (it would be confusing for users)
  • Loading branch information
simonetripodi committed Jun 28, 2012
1 parent 543abae commit a56da882025434f3edbe88f4f41e8b6e118fb3e2
Showing 1 changed file with 6 additions and 6 deletions.
@@ -203,31 +203,31 @@ public boolean isEmpty()
*/
public Iterator<E> iterator()
{
return null;
throw new UnsupportedOperationException();
}

/**
* {@inheritDoc}
*/
public boolean remove( Object o )
{
return false;
throw new UnsupportedOperationException();
}

/**
* {@inheritDoc}
*/
public boolean removeAll( Collection<?> c )
{
return false;
throw new UnsupportedOperationException();
}

/**
* {@inheritDoc}
*/
public boolean retainAll( Collection<?> c )
{
return false;
throw new UnsupportedOperationException();
}

/**
@@ -243,15 +243,15 @@ public int size()
*/
public Object[] toArray()
{
return null;
throw new UnsupportedOperationException();
}

/**
* {@inheritDoc}
*/
public <T> T[] toArray( T[] a )
{
return null;
throw new UnsupportedOperationException();
}

/**

0 comments on commit a56da88

Please sign in to comment.