rmannibucau commented on a change in pull request #74:
URL: https://github.com/apache/johnzon/pull/74#discussion_r667304521



##########
File path: 
johnzon-core/src/main/java/org/apache/johnzon/core/JohnzonJsonParserImpl.java
##########
@@ -134,18 +140,57 @@ public void skipArray() {
 
     @Override
     public Stream<JsonValue> getArrayStream() {
-        //X TODO this implementation is very simplistic
-        //X I find it unintuitive what the spec intends here
-        //X we probably need to improve this
-        return getArray().stream();
+        Event current = current();
+        if (current != Event.START_ARRAY) {
+            throw new IllegalStateException(current + " doesn't support 
getArrayStream()");
+        }
+
+        Spliterator<JsonValue> arraySpliterator = new 
Spliterators.AbstractSpliterator<JsonValue>(

Review comment:
       if you think you need 2 inner classes it is fine for me too, what I want 
to ensure is that it is not referencing $0 (this).
   it is also fine ot inject the impl of tryAdvance as a lambda (the compiler 
will make it right normally) so maybe something along:
   
   > new SimpleSplitIterator(action -> {  Event next = next(); ..... });
   
   this enables to factorize the config and avoids the $0 ref.




-- 
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...@johnzon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to