pjfanning commented on code in PR #582:
URL: https://github.com/apache/poi/pull/582#discussion_r1477123234


##########
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:
   see 
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Character.html#toString(int)
   
   only added in Java 11



-- 
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

Reply via email to