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
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
public boolean remove(Object o) {
|
public boolean remove(Object o) {
|
||||||
for (IListNode node = getAnchor().getNextNode(); node != getAnchor(); node = node.getNextNode()) {
|
for (IListNode node = getAnchor().getNextNode(); node != getAnchor(); node = node.getNextNode()) {
|
||||||
boolean isEqual = false;
|
boolean isEqual = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
isEqual = ((Comparable<Object>)o).compareTo((node.getItem())) == 0;
|
isEqual = ((Comparable) o).compareTo((node.getItem())) == 0;
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
|
||||||
isEqual = node.getItem() == o;
|
isEqual = node.getItem() == o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue