[ 
https://issues.apache.org/jira/browse/CAMEL-24580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18110339#comment-18110339
 ] 

Claus Ibsen commented on CAMEL-24580:
-------------------------------------

The numeric-favoring comparison for all-digit strings (e.g. "0001" == "001" -> 
true) is intentional, long-standing behavior in Simple, introduced in 
CAMEL-15587 (2020) as a performance/usability optimization. It has been in 
place for years and is correct as-is.

Given that, I would not go with either the narrow or broad scope proposed above 
-- this is not a bug. [~karkra321], please close this as Not A Bug / Won't Fix. 
Users who need strict String equality for zero-padded identifiers should 
compare with explicit quoting/handling rather than relying on == doing text 
comparison.

_Posted by Claude Code on behalf of davsclaus_

> simple predicate always casts digital strings as numbers
> --------------------------------------------------------
>
>                 Key: CAMEL-24580
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24580
>             Project: Camel
>          Issue Type: Bug
>          Components: came-core
>            Reporter: Ivan Ravin
>            Assignee: Karol Krawczyk
>            Priority: Major
>
> Due to this error, strings with leading zeros are compared incorrectly
> {code:java}
> from("timer:test?repeatCount=1&delay=1000")
> .setHeader("Account1").constant("0001")
> .setHeader("Account2").constant("001")
> .filter().simple("${header.Account1} == ${header.Account2}")
>     .log(LoggingLevel.ERROR, "Accounts not equals")
> .end(); {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to