ClassCastException in UnsignedInt and UnsignedLong
--------------------------------------------------

         Key: AXIS-2327
         URL: http://issues.apache.org/jira/browse/AXIS-2327
     Project: Apache Axis
        Type: Bug
  Components: Basic Architecture  
    Versions: 1.3    
 Environment: JDK 1.4.2, JDK 1.5, Axis 1.1 - 1.3
    Reporter: Martin Renner


The following code raises a ClassCastException in UnsignedInt.compareTo().

--------------------
import org.apache.axis.types.UnsignedInt;

public class Test {
   public static void main(String[] args) throws Exception {
        UnsignedInt i1 = new UnsignedInt(10);
        UnsignedInt i2 = new UnsignedInt(20);
        System.out.println(i1.compareTo(i2));
    }
}
--------------------

The reason for this bug is the following code in UnsignedInt.compareTo():
    return lValue.compareTo(obj);
which resolves to (symbolically)
    return Long.compareTo(UnsignedInt)
which is not allowed.


The same bug exists in UnsignedLong, which makes it impossible to use
  UnsignedByte
  UnsignedShort
  UnsignedInt
  UnsignedLong
in Maps etc.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to