Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000919 [Resin] major always 02-06-06 17:15 04-07-06 10:02
Reporter m5 View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.0.17
Summary 0000919: JSTL EL: numeric binary expression type promotion order is out-of-spec
Description The JSP 2.0 specification (JSP. specifies the sequence in which type promotion checks on binary operator arguments should be performed. In particular, the specification calls for the treatment of String-valued operands that include "tell-tale" float/double characters to be identical to that of actual Float or Double operands. That is, the presence of a String-valued operand that "looks like" a Float or a Double is supposed to cause the binary operator to be evaluated against the pair of operands after coercing them both to Double.

The Resin "BinaryExpr" class, however, has tests that prefer operands that are "Number" instances to Strings that look like Doubles. The result is that an expression like

  ${0 +}

will fail when the String operand looks like "1.0". The failure occurs because Resin notices that the first operand is a Long (i.e., a Number) before it checks to see whether the second operand is a String that looks like a Double. In my opinion that behavior is clearly counter to the spec.

For reasons I can't explain, this did not seem to be a problem in the 3.0.14 version, though the code seems similar in intent.
Additional Information Incidentally, in the 3.0.17 source there's a bug that was also in the 3.0.14 source. The test to see whether the "B" operand is a Float or a Double instead checks to see whether it's a Double twice:

    if (bObj instanceof Double || bObj instanceof Double) {

(line 112 in the 3.0.17 source).
Attached Files

- Relationships

- Notes
04-07-06 10:02


- Issue History
Date Modified Username Field Change
02-06-06 17:15 m5 New Issue
02-07-06 06:14 m5 Issue Monitored: m5
04-07-06 10:02 ferg Note Added: 0001052
04-07-06 10:02 ferg Assigned To  => ferg
04-07-06 10:02 ferg Status new => closed
04-07-06 10:02 ferg Resolution open => fixed
04-07-06 10:02 ferg Fixed in Version  => 3.0.19

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker