Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/JIBX-50

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JIBX-50
    Summary: Unbounded sequence with minOccurs=0 --> NullPointerException
       Type: Bug

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: JiBX
 Components: 
             xsd2jibx
   Versions:
             xsd2jibx 0.2

   Assignee: 
   Reporter: Tom Studer

    Created: Tue, 16 Nov 2004 7:32 AM
    Updated: Tue, 16 Nov 2004 7:32 AM

Description:
If I define unbounded element sequences with minOccurs=0 in a schema and then 
xsd2jibx process the schema, the generated code throws a NullPointerException 
on calling the size...() method. Example:

In the XSD below, I have to set minOccurs to 1 (element workbenchList) in order 
for the generated code to not throw a NullPointerException when calling the 
generated sizeWorkbenchList() method.

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema 
        targetNamespace="http://workbenchlist.jibx.v1.swidARD.ubs.com"; 
        xmlns="http://workbenchlist.jibx.v1.swidARD.ubs.com";
        xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
        
    <xsd:element name="url" type="xsd:string"/>
    
    <xsd:element name="workbench">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element maxOccurs="unbounded" minOccurs="1" ref="url"/>
            </xsd:sequence>
            <xsd:attribute name="description" type="xsd:string" use="optional"/>
            <xsd:attribute name="swid" type="xsd:string" use="optional"/>
            <xsd:attribute name="version" type="xsd:string" use="optional"/>
        </xsd:complexType>
    </xsd:element>
    
    <xsd:element name="workbenchList">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element maxOccurs="unbounded" minOccurs="1" 
ref="workbench"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
        
</xsd:schema>






---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
jibx-devs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to