-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
Oliver Becker opened SPR-9164 and commented
When doing number arithmetic in SpEL the result type is apparently one of double, long or int.
This has the unwanted effect that for example float or BigDecimal values will be changed to int.
new java.math.BigDecimal("12.34")
evaluates to 12.34
-(new java.math.BigDecimal("12.34"))
evaluates to -12
see org.springframework.expression.spel.ast
OpPlus, OpMinus, OpMultiply, OpDivide
Affects: 3.1.1
Reference URL: #80
Attachments:
- SpELFloatLiteralTest.java (1.24 kB)
Issue Links:
- Expression language not compare BigDecimals with integers [SPR-8716] #13358 Expression language not compare BigDecimals with integers ("is duplicated by")
- SpEL: OpEQ should use equals() [SPR-9194] #13832 SpEL: OpEQ should use equals()
- Downgrade accidental use of Java 1.7 APIs [SPR-11319] #15943 Downgrade accidental use of Java 1.7 APIs
- Add SpEL support for float literals [SPR-9486] #14121 Add SpEL support for float literals
- SpEL's arithmetic operations should explicitly detect BigInteger/Short/Byte and fall back to double handling for unknown Number subtypes [SPR-9913] #14546 SpEL's arithmetic operations should explicitly detect BigInteger/Short/Byte and fall back to double handling for unknown Number subtypes
1 votes, 7 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: enhancementA general enhancementA general enhancement