diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java index ebc4697b65a..541629977d1 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java @@ -17,11 +17,8 @@ import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; import java.util.List; import java.util.Objects; -import java.util.StringTokenizer; import java.util.concurrent.ThreadLocalRandom; import java.util.stream.IntStream; @@ -984,36 +981,6 @@ public class StringUtil return csvSplit(s, 1, s.length() - 2); } - /** - * Present the results of a {@link StringTokenizer} as an {@link Iterator} of type {@link String} - * @param input the StringTokenizer input - * @param delim the StringTokenizer delim - * @return the resulting iterator for the StringTokenizer - * @see StringTokenizer#StringTokenizer(java.lang.String, java.lang.String) - */ - public static Iterator tokenizerAsIterator(String input, String delim) - { - if (isBlank(input)) - return Collections.emptyIterator(); - - return new Iterator<>() - { - StringTokenizer tokenizer = new StringTokenizer(input, delim); - - @Override - public boolean hasNext() - { - return tokenizer.hasMoreTokens(); - } - - @Override - public String next() - { - return tokenizer.nextToken(); - } - }; - } - /** * Parse a CSV string using {@link #csvSplit(List, String, int, int)} *