Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IonFactory.createParser(IonReader) does not initialize state #436

Open
cowtowncoder opened this issue Dec 30, 2023 · 0 comments
Open

IonFactory.createParser(IonReader) does not initialize state #436

cowtowncoder opened this issue Dec 30, 2023 · 0 comments

Comments

@cowtowncoder
Copy link
Member

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

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

No branches or pull requests

1 participant