diff --git a/core/java/src/net/i2p/util/OrderedProperties.java b/core/java/src/net/i2p/util/OrderedProperties.java index c9b7cccd8..402e360d1 100644 --- a/core/java/src/net/i2p/util/OrderedProperties.java +++ b/core/java/src/net/i2p/util/OrderedProperties.java @@ -39,14 +39,14 @@ public class OrderedProperties extends Properties { public Set keySet() { if (size() <= 1) return super.keySet(); - return new UnmodifiableSortedSet(super.keySet()); + return new UnmodifiableSortedSet(super.keySet()); } @Override public Set> entrySet() { if (size() <= 1) return super.entrySet(); - return new UnmodifiableSortedSet(super.entrySet(), ECOMP); + return new UnmodifiableSortedSet>(super.entrySet(), ECOMP); } private static class EntryComparator implements Comparator>, Serializable { diff --git a/core/java/src/net/i2p/util/UnmodifiableSortedSet.java b/core/java/src/net/i2p/util/UnmodifiableSortedSet.java index ecf623cc0..4bf3882ff 100644 --- a/core/java/src/net/i2p/util/UnmodifiableSortedSet.java +++ b/core/java/src/net/i2p/util/UnmodifiableSortedSet.java @@ -39,6 +39,7 @@ public class UnmodifiableSortedSet extends ArraySet implements SortedSet c, Comparator comparator) { super(c, c.size()); comp = comparator; @@ -58,6 +59,7 @@ public class UnmodifiableSortedSet extends ArraySet implements SortedSet c, Comparator comparator) { super(c, c.size()); comp = comparator; @@ -69,12 +71,14 @@ public class UnmodifiableSortedSet extends ArraySet implements SortedSet comparator() { return comp; } + @SuppressWarnings("unchecked") public E first() { if (isEmpty()) throw new NoSuchElementException(); return (E) _entries[0]; } + @SuppressWarnings("unchecked") public E last() { int sz = size(); if (sz <= 0) @@ -145,6 +149,7 @@ public class UnmodifiableSortedSet extends ArraySet implements SortedSet