Skip to content

SpEL: OpEQ should use equals() [SPR-9194] #13832

@spring-projects-issues

Description

@spring-projects-issues

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:

2 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions