Hello,
I've just used fieldSet#readDate methods.
If I use pattern='yyyyMMdd' and read the value '4010822' everything is ok, even if there's only 3 digits for the year.
Following code :
Outputs :Code:DefaultFieldSet lFieldSet = new DefaultFieldSet(new String[] {"4010822"}); System.out.println(lFieldSet.readDate(0,"yyyyMMdd"));
I've just decorated the default FieldSet with my own and added a readStrict method which uses SimpleDateFormat with setLenient (false).Code:Sun Oct 02 00:00:00 CEST 4016
Shouldn't it be better for everyone to add the non lenient version in Spring Batch (or at least a boolean / sthing like that) ?
Here's the code if someone needs it (not very much actually)


Reply With Quote