gautamdudeja90 / beanio

Automatically exported from code.google.com/p/beanio
Apache License 2.0
0 stars 1 forks source link

An array of beans causes position to be calcuated incorrectly for fixed length records #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If there is an fixed size array or collection of beans in a record followed by 
some additional fields, the position calculated is incorrect for the fields 
following the collection.  Attached is a simple test case.  Notice that the 
field results ends up in the collection.  

<stream name="header" format="fixedlength">
<record name="header" class="com.abc.HeaderTest">
<field name="districtCode" length="10" />
<bean name="taxDetails" class="com.abc.TaxDetails" collection="array" 
minOccurs="10" maxOccurs="10">
    <field name="taxCode" length="4" />
    <field name="taxRate" length="10" padding="0" justify="right" />
    <field name="taxAmount" length="16" padding="0" justify="right"/>
</bean>         
<field name="status" length="2" />          
<field name="results" length="12" />
</record>       
</stream>

ABCS          00000000000000000000000000S Results     0000000000034.45    
00000000000000000000000000    00000000000000000000000000    
00000000000000000000000000    00000000000000000000000000    
00000000000000000000000000    00000000000000000000000000    
00000000000000000000000000    00000000000000000000000000

Original issue reported on code.google.com by brianbla...@gmail.com on 7 Apr 2011 at 9:14

Attachments:

GoogleCodeExporter commented 9 years ago
Good catch!  I've created a test case that reproduces the issue and will start 
looking into a solution.

My schedule is very hectic next week, so I hope to have a patch release in 
roughly 2 weeks.  Thanks for your patience.

Original comment by kevin.s...@gmail.com on 8 Apr 2011 at 4:27

GoogleCodeExporter commented 9 years ago
Fix committed to trunk.  It will still be a couple weeks before I can create a 
1.0.1 release, but I've attached a snapshot build of the beanio JAR that 
includes the fix.  Let me know if you have any further issues.  Thanks!

Original comment by kevin.s...@gmail.com on 8 Apr 2011 at 11:22

Attachments: