Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JiBX 1.2.2
-
Fix Version/s: None
-
Component/s: BindGen
-
Labels:None
-
Environment:java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
Linux, x86_64, 2.6.33.3
-
Number of attachments :
Description
Stacktrace:
Exception in thread "main" java.lang.NullPointerException
at java.util.HashMap.putAll(HashMap.java:498)
at org.jibx.binding.generator.BindGen.fillStructure(BindGen.java:550)
at org.jibx.binding.generator.BindGen.fillStructure(BindGen.java:592)
at org.jibx.binding.generator.BindGen.defineCollection(BindGen.java:339)
at org.jibx.binding.generator.BindGen.addMemberBindings(BindGen.java:428)
at org.jibx.binding.generator.BindGen.addMapping(BindGen.java:754)
at org.jibx.binding.generator.BindGen.generateMappings(BindGen.java:1069)
at org.jibx.binding.generator.BindGen.generate(BindGen.java:1138)
at org.jibx.binding.generator.BindGen.main(BindGen.java:1292)
BindGen was called with:
-c path/to/mycustomization.xml japa.parser.ast.CompilationUnit
The customization file was:
<custom> <class name="japa.parser.ast.Node" excludes="data"/> </custom>
In order to reproduce you need to have javaparser library on your classpath. These are the classes I am trying to generate binding for. You can download the library from the itself homesite: http://code.google.com/p/javaparser/downloads/list I used version 1.0.8.
The problem doesn't appear when excludes attribute is not used.
I am not sure, but I would guess there should be a null check on the detail.getAccessMethodMap():
The setAccessMethodMap() method is not called at all for this BindingMappingDetail.