tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42988] New: - java.lang.String.compareTo(Object) missing
Date Fri, 27 Jul 2007 14:11:13 GMT
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=42988>.
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=42988

           Summary: java.lang.String.compareTo(Object) missing
           Product: Tomcat 6
           Version: 6.0.11
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: blindsaypatten@netscape.net


Actual version of tomcat is 6.0.13 but that is not in the drop down.
I would guess that this affects all platforms and OSs that use the supplied
compiler.  

It appears that the compareTo(Object) method of java.lang.String was not
implemented.
test.jsp:
<%
  String a = "a";
  String b = "b";
  Object bo = b;
  try {
    out.println("a.compareTo(bo)=" + a.compareTo(bo));
  } catch(Exception e) {
    out.println("String.compareTo(Object) throws Exception: " + e);
  }
%>
Resulting error message:
An error occurred at line: 6 in the jsp file: /temp/test.jsp
The method compareTo(String) in the type String is not applicable for the
arguments (Object)
3:   String b = "b";
4:   Object bo = b;
5:   try {
6:     out.println("a.compareTo(bo)=" + a.compareTo(bo));
7:   } catch(Exception e) {
8:     out.println("String.compareTo(Object) throws Exception: " + e);
9:   }

The workaround in my case is to cast the Object to a String, I don't know if
there are cases where that workaround does not apply. In any case,
java.lang.String seems to be a pretty critical class to have implemented
completely and correctly.

-- 
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@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message