Closed GoogleCodeExporter closed 8 years ago
Thanks, I was able to reproduce the issue and am working on a solution.
Original comment by kevin.s...@gmail.com
on 26 Apr 2012 at 3:41
Thanks for the quick issue acceptance.
I was wondering if the fix would make it back to v1.2.x and what you think
would be a timeline for a fix/build (as usual, we are a little under the gun on
a project).
Please let us know if we can assist in any way; if you could point us in the
right direction within the code, we can attempt a fix....
Thanks,
Chet
Original comment by cbanner...@gmail.com
on 26 Apr 2012 at 2:39
Hi Chet,
A fix will definitely be applied to the next 1.2.x release. (I didn't try it,
but I doubt the issue exists in 2.x.) I hope to have a patch in the next few
days.
The issue is in class FlatStreamDefinitionFactory, although bewarned there is
some code I'm not particularly proud of in there :) I tried simply commenting
out the call to the method that performs the validation, but it looks like its
still computing the record length incorrectly so that won't get you too far...
I don't think the fix will be too difficult- I just need to find the time to do
it right...
Thanks,
Kevin
Original comment by kevin.s...@gmail.com
on 26 Apr 2012 at 6:42
Hi Kevin,
I was focussing my attention on FlatStreamDefinitionFactory as well...
Ironically, I had commented out the call to validateCollections, but as you
point out, the total length is being computed incorrectly. :)
I wonder if the same 'logocal' fix needs to be applied to two methods in this
class?
Thanks in advance, and awesome job on bean IO overall!
Original comment by cbanner...@gmail.com
on 26 Apr 2012 at 6:51
Kevin,
Just noticed something interesting. It appears this error is thrown when there
are fields in more than one spot inside a bean which is already a child. For
example, this works:
<stream name="records" format="fixedlength">
<record name="record" class="com.amig.beanio.Master">
<field name="master" length="10" />
<bean name="l1List" collection="list" minOccurs="2" maxOccurs="2" class="com.amig.beanio.Level1">
<field name="l1" length="10"/>
<bean name="l2List" collection="list" minOccurs="3" maxOccurs="3" class="com.amig.beanio.Level2">
<bean name="l3List" collection="list" minOccurs="2" maxOccurs="2" class="com.amig.beanio.Level3">
<field name="l3" length="10"/>
</bean>
<field name="l2" length="10"/>
<bean name="l3List" collection="list" minOccurs="2" maxOccurs="2" class="com.amig.beanio.Level3">
<field name="l3" length="10"/>
</bean>
</bean>
</bean>
<field name="eof" length="3" padding=" " justify="left"/>
</record>
</stream>
But this does not:
<stream name="records" format="fixedlength">
<record name="record" class="com.amig.beanio.Master">
<field name="master" length="10" />
<bean name="l1List" collection="list" minOccurs="2" maxOccurs="2" class="com.amig.beanio.Level1">
<field name="l1" length="10"/>
<bean name="l2List" collection="list" minOccurs="3" maxOccurs="3" class="com.amig.beanio.Level2">
<field name="l2" length="10"/>
<bean name="l3List" collection="list" minOccurs="2" maxOccurs="2" class="com.amig.beanio.Level3">
<field name="l3" length="10"/>
</bean>
<field name="l2" length="10"/>
</bean>
</bean>
<field name="eof" length="3" padding=" " justify="left"/>
</record>
</stream>
Original comment by cbanner...@gmail.com
on 26 Apr 2012 at 7:05
Fixed for release 1.2.5.
Chet, let me know if the attached snapshot JAR doesn't work for you. Thanks!
Original comment by kevin.s...@gmail.com
on 28 Apr 2012 at 7:10
Attachments:
Kevin,
Looks like your changes worked. Thank you so much for your quick response!
Chet
Original comment by cbanner...@gmail.com
on 1 May 2012 at 4:49
Original comment by kevin.s...@gmail.com
on 19 May 2012 at 3:58
Original issue reported on code.google.com by
cbanner...@gmail.com
on 25 Apr 2012 at 9:17Attachments: