-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Oliver Becker opened SPR-9194 and commented
The implementation of the SpEL == operator in org.springframework.expression.spel.ast.OpEQ does some special handling for Number types and Comparables, but finally uses left == right.
I think it should always call left.equals(right) - or for null-safety left == null ? right == null : left.equals(right)
This would be consistent with Scala or Groovy, for example.
As for the number types: a float 1.2 would be equal to a short 1 (see also https://jira.springsource.org/browse/SPR-9164)
Affects: 3.1.1
Issue Links:
- ClassCastException when evaluating the eq/ne operator in the EL [SPR-11708] #16330 ClassCastException when evaluating the eq/ne operator in the EL
- SpEL: Compiled OpNE should favor equals() to != [SPR-14863] #19429 SpEL: Compiled OpNE should favor equals() to !=
- Support BigDecimals with SpEL [SPR-9164] #13802 Support BigDecimals with SpEL
2 votes, 6 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug