tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 57309] Custom type conversion sometimes bypassed
Date Sat, 06 Dec 2014 16:43:04 GMT

--- Comment #3 from Konstantin Kolinko <> ---
Reviewing r1643367
Reviewing, 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 bd1 = (BigDecimal) coerceToNumber(ctx, obj1,
            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:
For additional commands, e-mail:

View raw message