Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JiBX 1.1.3
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The following mapping works fine for me:
<mapping name="..." class="de....">
<structure set-method="set..." get-method="get..." usage="optional" ordered="false">
<value name="..." field="..." usage="optional"/>
<structure name="..." usage="optional">
<value name="..." field="..." usage="optional" type="java.util.Date"/>
<value name="..." field="..." usage="optional" type="java.util.Date"/>
</structure>
</structure>
</mapping>
When i change the second structure to ordered="false" (and that is what i need) i get this stacktrace:
Error running binding compiler
-
-
- Error during code generation - please enter a bug report for this error in Jira if the problem is not listed as fixed on the online status page ***
-
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.get(ArrayList.java(Compiled Code))
at org.jibx.binding.classes.MethodBuilder.appendLoadLocal(MethodBuilder.java:1094)
at org.jibx.binding.def.NestedStructure.genFlagTest(NestedStructure.java:327)
at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:244)
at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:795)
at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:940)
at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:193)
at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:795)
at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:940)
at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:582)
at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:603)
at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:661)
at org.jibx.binding.Compile.compile(Compile.java:305)
at org.jibx.binding.Compile.main(Compile.java:385)
at de.fraunhofer.iao.arpos.utils.JiBX.compileKostenvoranschlag(JiBX.java:44)
at de.fraunhofer.iao.arpos.utils.JiBX.main(JiBX.java:29)
Can you try this with the current cvs code (or even the 1.1.2 jars from http://www.jibx.org/maven/jibx/jars)? I believe this has been corrected, but if it breaks please supply a zip with sample project demonstrating the problem.