Peter Cowan created XERCESJ-1620:
------------------------------------

             Summary: ClassCastException in XMLGregorianCalendar when comparing 
different implementations of XMLGregorianCalendar
                 Key: XERCESJ-1620
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1620
             Project: Xerces2-J
          Issue Type: Bug
          Components: JAXP (javax.xml.datatype)
    Affects Versions: 2.11.0
            Reporter: Peter Cowan


When using the compare method on the XMLGregorianCalendarImpl, it attempts to 
cast both the lhs and the rhs XMLGregorianCalendars to an 
XMLGregorianCalendarImpl.
If a user supplies a non-Xerces or repackaged implementation of 
XMLGregorianCalendar to this method a ClassCastException is thrown.
The objects P and Q that are created from the cast to XMLGregorianCalendarImpl 
are then passed to the internalCompare method which only requires the arguments 
to be the abstract class, rendering the cast irrelevant.

Since the equality of a Xerces XMLGregorianCalendar delegates to compare, the 
equals method is then prone to throwing the ClassCastException if a non-Xerces 
or repackaged implementation is supplied.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to