Repository navigation
Match loose enum numeric strings by exact value - #1353
Merged
Merged
Conversation
Contributor
Author
|
Independent review of Verified
Findings (low severity)
🤖 Generated with Claude Code |
Contributor
Author
|
Follow-up on
Outcomes
I did not run the full JDK matrix locally; CI covers it. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Loose numeric enum matching currently depends on Jackson's text formatting:
enum: [100]accepts"1E+2"on master and"100"on 2.x. Match finite numeric members by exact decimal value on both branches, so"100","100.0"and"1E+2"all match.Prepare compact sign/coefficient/power keys once per converted enum member and parse each candidate string once. The parser validates complete JSON number syntax and scans huge exponents using saturating long arithmetic, without expanding zeros or allocating an arbitrary-size exponent integer.
Fixes #1349.
Compatibility
typeLooseis enabled. Strict mode and literal string enum members keep their existing semantics.JsonNodeValueequality/hashing is unchanged.Validation
mvn -B clean verify: JDK 17/21/25; 10,451 unit cases and one artifact check per run, zero failures/errors, 30 existing skips.These are local results; remote CI must qualify this PR separately.
Review follow-up
9007199254740993.0matches"9007199254740992"; an explicitUSE_BIG_DECIMAL_FOR_FLOATSreader preserves and matches"9007199254740993". This boundary remains intentional; reader precision policy is unchanged.