Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 0.9.4.2, 1.0, 1.0.1, 1.0.2, 1.0.3
-
Fix Version/s: 1.0.4
-
Component/s: XML code generator
-
Labels:None
-
Environment:Operating System: Linux
Platform: Sun
-
Bugzilla Id:1243
Description
This NullPointerException turns up when generating java source for the STMML
schema (www.xml-cml.org/schema/stmml):
Exception in thread "main" java.lang.NullPointerException
at org.exolab.castor.builder.TypeConversion.compare(TypeConversion.java:522)
at
org.exolab.castor.builder.TypeConversion.findCommonType(TypeConversion.java:506)
at
org.exolab.castor.builder.TypeConversion.convertType(TypeConversion.java:100)
at
org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType(XMLBindingComponent.java:1103)
at
org.exolab.castor.builder.MemberFactory.createFieldInfo(MemberFactory.java:221)
at
org.exolab.castor.builder.SourceFactory.processAttributes(SourceFactory.java:1213)
at
org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:1295)
at
org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java:326)
at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java:1249)
at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java:1186)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:490)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:549)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:580)
at org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:1135)
Applying this patch makes it go again:
— src/main/org/exolab/castor/builder/TypeConversion.java.original Thu Mar
6 10:04:57 2003
+++ src/main/org/exolab/castor/builder/TypeConversion.java Thu Mar 6
10:04:16 2003
@@ -518,6 +518,9 @@
- if the types are not compatable.
*/
private static SimpleType compare(SimpleType aType, SimpleType bType) {
+ if (aType == null) return bType;
+ if (bType == null) return aType;
+
int type1 = aType.getTypeCode();
int type2 = bType.getTypeCode();
Hopefully this is useful,
kind regards,
Egon Willighagen
Issue Links
- relates to
-
CASTOR-1421
xsd:integer is not correctly mapped to BigInteger (java.lang.NumberFormatException)
-
Thanks Egon, I'll review the patch and get it into the CVS soon.