From aee1199beecdd6a771b7213b962d13153120fcf4 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 28 Sep 2022 09:47:07 +0200 Subject: [PATCH] Suppress unnecessary warnings --- app/src/main/java/ch/nuth/zhaw/exbox/MyList.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 bbb5485..d66076d 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/MyList.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/MyList.java @@ -197,15 +197,14 @@ public class MyList extends AbstractList { } @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)o).compareTo((node.getItem())) == 0; - } - catch (Exception e) { + isEqual = ((Comparable) o).compareTo((node.getItem())) == 0; + } catch (Exception e) { isEqual = node.getItem() == o; }