pjfanning commented on code in PR #582: URL: https://github.com/apache/poi/pull/582#discussion_r1477123146
########## poi/src/main/java/org/apache/poi/util/CodepointsUtil.java: ########## @@ -26,13 +26,21 @@ public class CodepointsUtil { /** * @param text to iterate over * @return iterator with Strings representing the codepoints - * @see #primitiveIterator(String) a more performant iterator */ - public static Iterator<String> iteratorFor(String text) { - return text.codePoints() - .mapToObj(codePoint -> new String(Character.toChars(codePoint))) - .iterator(); - } + public static Iterator<String> iteratorFor(String text) { + PrimitiveIterator.OfInt iter = primitiveIterator(text); + return new Iterator<String>() { + @Override + public boolean hasNext() { + return iter.hasNext(); + } + + @Override + public String next() { + return Character.toString(iter.next()); Review Comment: was this method not added after Java 8? We require Java 8 support. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org