Suppress unnecessary warnings
This commit is contained in:
parent
8a80db94a9
commit
aee1199bee
1 changed files with 3 additions and 4 deletions
|
@ -197,15 +197,14 @@ public class MyList extends AbstractList<Object> {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public boolean remove(Object o) {
|
||||
for (IListNode node = getAnchor().getNextNode(); node != getAnchor(); node = node.getNextNode()) {
|
||||
boolean isEqual = false;
|
||||
|
||||
try {
|
||||
isEqual = ((Comparable<Object>)o).compareTo((node.getItem())) == 0;
|
||||
}
|
||||
catch (Exception e) {
|
||||
isEqual = ((Comparable) o).compareTo((node.getItem())) == 0;
|
||||
} catch (Exception e) {
|
||||
isEqual = node.getItem() == o;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue