Hi!

In my opinion, the following issue is a bug. Do you agree?
Here is a minimal example:

The following schema is used by the SourceGenerator without additional
mapping. That works fine. Read on after the schema...

----snip example.xsd-----
 <element name='report'>
  <complexType>
   <sequence>
    <element ref='t:A'/>
    <choice>
     <element ref='t:B'/>
     <element ref='t:C'/>
    </choice>
   </sequence>
  </complexType>
 </element>
  
 <element name='A'>
  <complexType>
  </complexType>
 </element>
  
 <element name='B'>
  <complexType>
  </complexType>
 </element>

 <element name='C'>
  <complexType>
  </complexType>
 </element>
----

Now, if i try to unmarshal the following invalid document, a
StackOverflowError is thrown.

---document---
<A>
</A>        
        
<B>
</B>

<C>
</C>
-----

Here's the Error

java.lang.StackOverflowError
        at
org.exolab.castor.xml.util.XMLFieldDescriptorImpl.getFieldName(XMLFieldDescriptorImpl.java:441)
        at
org.exolab.castor.xml.util.XMLFieldDescriptorImpl.equals(XMLFieldDescriptorImpl.java:364)
        at java.util.Vector.indexOf(Vector.java:363)
        at java.util.Vector.contains(Vector.java:321)
        at
org.exolab.castor.xml.UnmarshalState.isUsed(UnmarshalState.java:168)
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:799)
        at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1388)
        at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1626)
        ...
The last line is repeated may times (loop).

Interessting: The problem ist correctly handled (exception with nice error
message), if you drop element A from the schema and document...

Best regards
Henning

-- 
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to