https://issues.apache.org/bugzilla/show_bug.cgi?id=57309

--- Comment #3 from Konstantin Kolinko <knst.koli...@gmail.com> ---
Reviewing r1643367
Reviewing ELSupport.compare(Object, Object) and coerceToNumber(ctx, Object,
BigDecimal.class) calls there:

1. The first branch in compare() method:
        if (isBigDecimalOp(obj0, obj1)) {
            BigDecimal bd0 = (BigDecimal) coerceToNumber(ctx, obj0,
BigDecimal.class);
            BigDecimal bd1 = (BigDecimal) coerceToNumber(ctx, obj1,
BigDecimal.class);
            return bd0.compareTo(bd1);
        }

In this branch isBigDecimalOp check returned true, so one of operands is
already a BigDecimal.

QUESTION: Does coerceToNumber() need to call ELResolver to convert it? Can it
skip conversion if the object is already of the expected type.


2. Minor
                if (ctx.isPropertyResolved()) {
                    return (Number) result;
                }
It could be type.cast(result).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to