gautamdudeja90 / beanio

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

Trim doesn't work on last field #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I get validation excepion as trimming seems to fails on delimited streams with 
trailing spaces in the last field (actually I didn’t test if there are 
problems also with other positions).
There is no error if I remove spaces at the end of the record.

Everything was fine using 1.2.2 version and stopped working when I moved to 
2.0.1. I am using JDK 6.

To get it working I had to move back to 1.2.2 version.

Here is an extract of the mapping:

<parser>
<property name="delimiter" value=";" />
</parser>
<record name="onBoardingTrailer" minOccurs="1" 
class="net.giomag.sbp.io.OnBoardingHeader">
 <field name="recordType" rid="true" literal="10" ignore="true" />
 <field name="dateSent" format="yyyyMMddHHmmss" />
 <field name="dateResponse" format="yyyyMMddHHmmss" trim="true" />
</record>

SAMPLE RECORD (quotation marks are for record delimitation, in order to show 
spaces: they’re not present in the real stream. 
"10;;20120712134531                                   " --> FAIL
"10;;20120712134531" --> OK

Best regards
Giovanni

Original issue reported on code.google.com by giova...@giomag.net on 19 Jul 2012 at 7:35

GoogleCodeExporter commented 9 years ago
Good find- trim is not working regardless of field position.  Fixed for release 
2.0.2.

A snapshot JAR is attached.

Thanks,
Kevin

Original comment by kevin.s...@gmail.com on 20 Jul 2012 at 2:57

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by kevin.s...@gmail.com on 20 Jul 2012 at 2:58

GoogleCodeExporter commented 9 years ago

Original comment by kevin.s...@gmail.com on 20 Jul 2012 at 2:59

GoogleCodeExporter commented 9 years ago
Issue 40 has been merged into this issue.

Original comment by kevin.s...@gmail.com on 29 Aug 2012 at 3:20

GoogleCodeExporter commented 9 years ago

Original comment by kevin.s...@gmail.com on 29 Sep 2012 at 8:48