Skip to content

JOHNZON-441 - implement currentEvent for RewindableJsonParser and JsonValueParserAdapter - #145

Open
jungm wants to merge 1 commit into
apache:masterfrom
jungm:issue/JOHNZON-441
Open

JOHNZON-441 - implement currentEvent for RewindableJsonParser and JsonValueParserAdapter#145
jungm wants to merge 1 commit into
apache:masterfrom
jungm:issue/JOHNZON-441

Conversation

@jungm

@jungm jungm commented Aug 25, 2026

Copy link
Copy Markdown
Member

@jungm
jungm requested a review from rmannibucau August 25, 2026 18:51

@rmannibucau rmannibucau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the changes enable the ticket, looks like they break the contract to me, is it intended?
Also I think we can just drop this rewindablejsonparser now no? did you test?

private <T> Stream<T> trackStream(final Stream<T> stream) {
pendingRewind = false;
last = delegate.currentEvent();
final boolean parallel = stream.isParallel();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if parallel nothing works I think

}
}
};
return StreamSupport.stream(tracking, parallel).onClose(stream::close);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why closing there, the caller must close it

return jsonValue;
}
}
/*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rework so the diff is accurate? (content is ok once done)

}

@Override
public Event next() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this potentially changes the behavior so should be refined I think if desired (looks ok upfront but having a broken test for it can be sane on the long run)

return delegate.currentEvent();
}
last = delegate.next();
pendingRewind = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks wrong to impl it there and violates the contract, if I call it on a new parser it should return null, the method is literally getLast() only (our getLast was pre JSON-P 2.1 as a minimum target)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants