From 47d5e0c050beb0161fa4d7e0a59844244d4444f6 Mon Sep 17 00:00:00 2001 From: gregw Date: Mon, 23 Sep 2024 11:25:13 +1000 Subject: [PATCH] Fix #12296 by partial revert of "Fixes #12289 - Improve ConcurrentPool concurrency. (#12290)" This reverts/modified parts of commit 115ee1cf3968d1027832852ed54304fffe60a77b. --- .../src/main/java/org/eclipse/jetty/util/TypeUtil.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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)