diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java index 9dd18d63d389..4075564595f8 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java @@ -65,7 +65,6 @@ public class TypeUtil public static final int CR = '\r'; public static final int LF = '\n'; private static final Pattern TRAILING_DIGITS = Pattern.compile("^\\D*(\\d+)$"); - private static final ListIterator EMPTY_LIST_ITERATOR = Collections.EMPTY_LIST.listIterator(); private static final HashMap> name2Class = new HashMap<>(); @@ -189,11 +188,7 @@ public static ListIterator listIteratorAtEnd(List list) { int size = list.size(); if (size == 0) - { - @SuppressWarnings("unchecked") - ListIterator emptyListIterator = (ListIterator)EMPTY_LIST_ITERATOR; - return emptyListIterator; - } + return Collections.emptyListIterator(); return list.listIterator(size); } catch (IndexOutOfBoundsException e)