simpleqt commented on PR #421:
URL: https://github.com/apache/commons-jexl/pull/421#issuecomment-7037038268

   Fair enough — I don't have a concrete application case. I found this while 
auditing the numeric predicates, not from a workload that produced a non-zero 
`BigDecimal` below `Double.MIN_VALUE`, so I can't offer the use case that would 
justify changing the default arithmetic.
   
   You're also right that a partial fix would be worse than the status quo: 
`empty(x)` would become false while `!x` and `x ? a : b` still treated the same 
value as false. If this were pursued, `toBoolean(Object)` would need the same 
`signum()` test and the tests you listed (`!x`, `x ? 1 : 2`, `x ?: 0`).
   
   I'll withdraw the pull request rather than carry a default-arithmetic change 
with no user behind it. For anyone who does need the exact behaviour today, 
overriding `isEmpty(Object, Boolean)` and `toBoolean(Object)` in a 
`JexlArithmetic` subclass with the `signum()`-based test is the route you 
described and needs no JEXL change. Thanks for the careful review.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to