jackson-dataformats-binary icon indicating copy to clipboard operation
jackson-dataformats-binary copied to clipboard

`IonFactory.createParser(IonReader)` does not initialize state

Open cowtowncoder opened this issue 6 months ago • 0 comments

(note: issue uncovered when working on fix for #434)

It looks like following method in IonFactory

    public IonParser createParser(IonReader in) {
        ...
    }

does not initialize state according to current state of IonReader. This is fine for the common case of newly constructed IonReader (which does not point to anything); but does not work as expected in case IonReader has been advanced to point to a token. This seems like a flaw and there is at least one unit test that appears to expect this to work: test in question has been working due to many methods in IonParser not verifying current token and getting information directly from IonReader. But this will be problematic when checking for, say, IonParser.currentToken() since Jackson streaming level state information is not properly set up.

Ideally, current token and other settings would be properly initialized.

cowtowncoder avatar Dec 30 '23 21:12 cowtowncoder