You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2006/01/25 14:31:38 UTC
DO NOT REPLY [Bug 38382] New: - equal tag bug : wrong string compare
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38382>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38382
Summary: equal tag bug : wrong string compare
Product: Struts
Version: 1.1 Final
Platform: PC
OS/Version: Windows 2000
Status: NEW
Severity: normal
Priority: P3
Component: Taglibs
AssignedTo: dev@struts.apache.org
ReportedBy: philippegen@yahoo.com
Hi,
I found something strange using tag <logic:equal>. I didn't find anything about
this problem, so I write a request here .
It seems logic:Equal tag can not compare properly a string like "35F" or "35D".
If you compare "35F" and "35", it says true, instead of false. I tried to debug
and found this :
1st) Tag tries to compare in DOUBLE_COMPARE
2nd) When comparing in "DOUBLE_COMPARE" mode , we do this :
if (type == DOUBLE_COMPARE) {
try {
double doubleVariable =
Double.parseDouble(variable.toString());
if (doubleVariable < doubleValue)
result = -1;
else if (doubleVariable > doubleValue)
result = +1;
} catch (NumberFormatException e) {
result = variable.toString().compareTo(value);
}
}
or, Double.parseDouble("35F") return 35.0
but Double.parseDouble("35A") throws Exception
In fact, Double.parseDouble("35F") or Double.parseDouble("35D") return 35.0
because F or D means Float or Double ...
Is the bug still exits in newer versions ?
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
DO NOT REPLY [Bug 38382] - equal tag bug : wrong string compare
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38382>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38382
niallp@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
------- Additional Comments From niallp@apache.org 2006-02-12 01:36 -------
Since JSTL now provides standard compare functionality this tag is no longer
being actively developed.
Closing as WONTFIX.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org