History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CASTOR-2270
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Werner Guttmann
Reporter: Abhinav Sopory
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
castor

ClassCastException when marshalling Iterator

Created: 22/Jan/08 05:11 PM   Updated: 14/Mar/08 06:41 AM
Component/s: XML
Affects Version/s: 1.1.2.1
Fix Version/s: 1.2

Time Tracking:
Original Estimate: 45 minutes
Original Estimate - 45 minutes
Remaining Estimate: 10 minutes
Time Spent - 35 minutes Remaining Estimate - 10 minutes
Time Spent: 35 minutes
Time Spent - 35 minutes Remaining Estimate - 10 minutes

File Attachments: 1. Java Source File DomainClass.java (0.3 kb)
2. Java Source File IteratorMarshallTest.java (1 kb)
3. Text File patch.c2270.20080123.txt (4 kb)

Environment: Windows

Testcase included: yes


 Description  « Hide
When trying to marshall a class which has a method that returns an Iterator a ClassCastException is thrown.

java.lang.ClassCastException: java.util.AbstractList$Itr
at org.exolab.castor.mapping.loader.J2CollectionHandlers$6.elements(J2CollectionHandlers.java:276)
at org.exolab.castor.mapping.loader.FieldHandlerImpl.getValue(FieldHandlerImpl.java:444)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1740)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:836)
at test.castor.IteratorMarshallTest.testMarshallIterator(IteratorMarshallTest.java:28)

This is because an Iterator is being cast to an Enumeration at line 276 in org.exolab.castor.mapping.loader.J2CollectionHandlers.

[Our project used Castor 0.9.9. We moved to Castor 1.1.2.1 recently and started seeing this problem]



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Werner Guttmann - 23/Jan/08 03:27 AM
Final patch for review.