jakartaee / expression-language

Jakarta Expression Language
https://eclipse.org/ee4j/el
Other
69 stars 50 forks source link

EL should coerce String to Integer in equals operation #114

Closed rmartinc closed 4 years ago

rmartinc commented 4 years ago

Same issue to the one commented in tomcat:

https://bz.apache.org/bugzilla/show_bug.cgi?id=52666

In the section 1.9.2 of EL 3.0 Specification, the ==,!= operators should coerce to numeric objects first if one of the operators is a number, String coercion is the last option. The current order in the code prioritizes first the String conversion and for example '01' == 1 returns false.

I'm going to send a PR with (more or less) the same change that @markt-asf performed in tomcat.