Skip to content

Spring SpEL - behavioural inconsistency when using greater than (>) operator in an expression [SPR-7840] #12496

Closed
@spring-projects-issues

Description

@spring-projects-issues

kailash pandey opened SPR-7840 and commented

While evaulating a Selection expression like -->
"#root.?[someproperty_Of_Type_X > someobject_Of_Type_X]",
where #root is a List<ApplicationObject>,

If the property on left hand side is null, then SpEL evaulates this condition as TRUE (ideally which should not be the case, u can't evaluate to true with null) and returns such underlying objects as part of Selection result.

Bigger problem arises when similar expression (as mentioned above) are tested with other operators like less than "<" or equals "==", SpEL treats them differently i.e. somehow it evaluates them as FALSE and as a result such underlying objects are eliminated from Selection result.

This is causing big problems in evaluating complex expressions and thus introducing misleading results.

Request to evaulate the problem stated above and provide solution to it .

Kailash


Affects: 3.0.2

Issue Links:

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