[ http://jira.codehaus.org/browse/JIBX-50?page=history ] Dennis Sosnoski closed JIBX-50: -------------------------------
> Unbounded sequence with minOccurs=0 --> NullPointerException > ------------------------------------------------------------ > > Key: JIBX-50 > URL: http://jira.codehaus.org/browse/JIBX-50 > Project: JiBX > Type: Bug > Components: xsd2jibx > Versions: xsd2jibx-beta0.2 > Reporter: Tom Studer > Assignee: Dennis Sosnoski > Fix For: 1.0-RC0 > > > 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> -- 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 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ jibx-devs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jibx-devs
