diff --git a/app/src/main/java/ch/nuth/zhaw/exbox/MyList.java b/app/src/main/java/ch/nuth/zhaw/exbox/MyList.java index d66076d..718011a 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/MyList.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/MyList.java @@ -197,18 +197,9 @@ public class MyList extends AbstractList { } @Override - @SuppressWarnings({ "rawtypes", "unchecked" }) public boolean remove(Object o) { for (IListNode node = getAnchor().getNextNode(); node != getAnchor(); node = node.getNextNode()) { - boolean isEqual = false; - - try { - isEqual = ((Comparable) o).compareTo((node.getItem())) == 0; - } catch (Exception e) { - isEqual = node.getItem() == o; - } - - if (isEqual) { + if (node.getItem().equals(o)) { node.getPreviousNode().setNextNode(node.getNextNode()); node.getNextNode().setPreviousNode(node.getPreviousNode()); return true;