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

Key: CASTOR-1160
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Werner Guttmann
Reporter: Nicolas cazottes
Votes: 0
Watchers: 0
Operations

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

Bug (NPE) in SourceGenerator for complexTypes containing union of union

Created: 01/Jul/05 07:26 AM   Updated: 03/Oct/06 10:25 AM
Component/s: XML code generator
Affects Version/s: 0.9.7
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. XML File unionOfUnionBug.xsd (1 kb)



 Description  « Hide
When using a ComplexType containing an element that is an union whose one
element is also an union, SourceGenerator falls on a NullPointerException while creating classes.
This happens with the latest version that is 0.9.7 and with older ones also.

The xsd that shows this problem is given in an attached file.

Here is the exception I get :

– using UNIX style line separation.
– Suppressing non fatal warnings.
Creating classes for: CreditCard
java.lang.NullPointerException
at
org.exolab.castor.builder.TypeConversion.compare(TypeConversion.java:567)
at
org.exolab.castor.builder.TypeConversion.findCommonType(TypeConversion.java:551)
at
org.exolab.castor.builder.TypeConversion.convertType(TypeConversion.java:132)
at
org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType(XMLBindingComponent.java:1185)
at
org.exolab.castor.builder.MemberFactory.createFieldInfo(MemberFactory.java:291)
at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.java:1508)
at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.java:1552)
at
org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:1464)
at
org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java:402)
at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java:1045)
at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java:931)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:370)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:452)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:485)
at
org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:865)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Werner Guttmann - 03/Oct/06 10:25 AM
My wild guess is that Castor (currently) does not support unions of unions. I could be wrong, though, but that's what the exception stack trace seems to indicate ...