[backport camel-4.18.x] CAMEL-24407: simple predicate fails for long digital strings - #25979
Merged
Merged
Conversation
Numbers with more digits than a long can hold, such as bank account numbers, made comparisons throw NumberFormatException. isNumber only checks that the text is all digits, and the callers then parsed it with Long.parseLong or Integer.valueOf. Compare those as BigInteger instead. A number that does not fit in a long can never equal an int or long, so equality with one is false. A numeric literal in a simple predicate that does not fit in a long is now kept as literal text, so it takes the same comparison path. Co-authored-by: Claude <noreply@anthropic.com>
gnodet
approved these changes
Aug 31, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Approving this backport of #25945 to camel-4.18.x.
The original PR (CAMEL-24407: simple predicate fails for long digital strings) was reviewed and approved — this backport carries the same changes across all 7 files. Straight cherry-pick with identical file list.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
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.
Backport of #25945
Cherry-pick of #25945 onto
camel-4.18.x.Original PR: #25945 - CAMEL-24407: simple predicate fails for long digital strings
Original author: @k-krawczyk
Target branch:
camel-4.18.xOriginal description
The
simplelanguage throwsNumberFormatExceptionwhen it compares numbers with more digitsthan a long can hold, such as bank account numbers.
ObjectHelper.isNumberonly checks that thetext is all digits, and the callers then parse it with
Long.parseLongorInteger.valueOf.String to String comparisons fall back to
BigIntegerwhen the value does not fit in a long.A number outside the long range can never equal an int or a long, so equality against one is
false, and ordering against one is decided asBigInteger. A numeric literal in a predicatethat does not fit in a long is now kept as literal text, so it takes the same comparison path
as a header would.
See #25945 for full details, reproduction and test coverage.
This is a straight cherry-pick with no manual conflict resolution; the change was already
reviewed and merged on
main.Claude Code on behalf of davsclaus