You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2009/09/04 15:54:31 UTC

DO NOT REPLY [Bug 47786] New: 100<4 in arithmetic evaluation - when 2 variables are used

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

           Summary: 100<4 in arithmetic evaluation - when 2 variables are
                    used
           Product: Taglibs
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Standard Taglib
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: vgavr@rogers.com


--- Comment #0 from Vasili <vg...@rogers.com> 2009-09-04 06:54:30 PDT ---
Hi,

I'm getting 100<4==true - when using 2 variables while using of constant on any
position - works correctly. I had to change the code (to take one variable from
a bean and that works as well - to fix the problem in my code. But this seems
to be weird...
Tried both jakarta-taglibs-standard-1.1.2.zip and jakarta-taglibs-20060829.zip
-  behave the same.

test.jsp demonstrating the bug:
------8<------
<% 
    long x=4;
    pageContext.setAttribute("x", Long.toString(x));

    long y=100;
    pageContext.setAttribute("y", Long.toString(y));
%>
y=${y},x=${x}, ${y}&lt;${x} is ${y<x}
<br>
However if we'll change any of variables to a constant - no problem: <br>
y=100,x=${x}, 100&lt;${x} is ${100<x}<br>
y=${y},x=4, ${y}&lt;4 is ${y<4}<br>
y=100,x=4, 100&lt;4 is ${100<4}<br>
------8<------

what I'm getting in the browser:

------8<------
y=100,x=4, 100<4 is true
However if we'll change any of variables to a constant - no problem:
y=100,x=4, 100<4 is false
y=100,x=4, 100<4 is false
y=100,x=4, 100<4 is false
------8<------

thanks
Vasili

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47786] 100<4 in arithmetic evaluation - when 2 variables are used

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47786

--- Comment #1 from Henri Yandell <ba...@apache.org> 2009-10-08 00:35:22 PDT ---
Thanks for the report Vasili. I'll get this into the unit tests for 1.2 to see
if that confirms and can then start debugging. Presumably the 100<4 is because
it's treating it alphabetically.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47786] 100<4 in arithmetic evaluation - when 2 variables are used

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47786

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Konstantin Kolinko <kn...@gmail.com> 2009-10-08 01:25:40 PDT ---
"100"<"4" is, indeed, true

Note, that you use Long.toString() and thus are comparing Strings.
If you replace those calls with Long.valueOf(), you will get all those four
"false"s that you are expecting.

Also, you are reporting this to a wrong product. EL expressions an a page are
evaluated by JSP engine that is part of the web server that you are using, and
not by any Taglib.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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