diff --git a/app/src/main/java/ch/nuth/zhaw/exbox/MySortedList.java b/app/src/main/java/ch/nuth/zhaw/exbox/MySortedList.java index ec4cdd1..0d6839a 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/MySortedList.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/MySortedList.java @@ -16,12 +16,7 @@ public class MySortedList extends MyList { int comparisonResult; try { - if (item instanceof Comparable x && - currentNode.getItem() instanceof Comparable y) { - comparisonResult = x.compareTo(y); - } else { - throw new UnsupportedOperationException(); - } + comparisonResult = ((Comparable) item).compareTo((Comparable) currentNode.getItem()); } catch (Exception e) { comparisonResult = 0; }