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

test for issue #4917 #4918

Open
wants to merge 4 commits into
base: 2.19
Choose a base branch
from
Open

test for issue #4917 #4918

wants to merge 4 commits into from

Conversation

pjfanning
Copy link
Member

@pjfanning pjfanning commented Jan 22, 2025

test case for #4917

@dbachdev
Copy link

so far does not seem to reproduce the claimed bug in #4917

could you please add: assertEquals(50, issue.number); ?

@pjfanning
Copy link
Member Author

pjfanning commented Jan 22, 2025

@cowtowncoder this test case does reproduce the issue for the double. It gets the wrong value - it gets the value from the decimal field instead.

So far, it seems like the issue was introduced in v2.15 - probably v2.15.0.

Unfortunately 2.15.0 has a lot of changes and it would seem that one of changes to bring in the lazy evaluation of numbers is the cause of this issue.

@pjfanning
Copy link
Member Author

@cowtowncoder FasterXML/jackson-core#1389 seems to fix this

@pjfanning
Copy link
Member Author

@cowtowncoder FasterXML/jackson-core#1389 has a test where I reproduced the issue

Maybe we could get 1389 and this merged to the 2.19 branches and backfit to jackson 2.18 and 2.17 (maybe 2.16)?

The issue is not related to TokenBuffer and appears to be related to using getNumberType call on the parser and then not using a call to get the number - which leaves behind a non-nulled _numberString value. When the next number is an int (in the JSON), the code does not update the _numberString and maintains the _numberInt directly but some code paths can then go back to _numberString despite it being for an earlier number.

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