albfernandez / javadbf

Java library for reading and writing Xbase (dBase/DBF) files.
GNU Lesser General Public License v3.0
224 stars 98 forks source link

IndexOutOfBoundsException when calling DBFReader#nextRecord() #56

Closed Hsiungchun closed 5 years ago

Hsiungchun commented 5 years ago

The four lines from the stack trace are as follows

java.lang.IndexOutOfBoundsException: Index: 13, Size: 13 at java.util.ArrayList.rangeCheck(ArrayList.java:657) at java.util.ArrayList.get(ArrayList.java:433) at com.linuxense.javadbf.DBFReader.nextRecord(DBFReader.java:327) ……

I found somewhere strange that may cause the problem. Whether should use recordObjects.get(j) instead of recordObjects.get(i) in DBFReader.java: 327?

Thanks!

albfernandez commented 5 years ago

VARCHAR and VARBINARY are not tested. Could you provide a sample file (no private data!!!) to test this type of fields and fix de bug? thanks

Hsiungchun commented 5 years ago

A sample file is shown below. In addition, it seems to apply to issues #25 and #26 .

javadbf#issue#56-testdata.zip

Thank you for your attention.

albfernandez commented 5 years ago

I've relases a new version (1.9.4). I hope it fixed your issue, could you try and confirm please?

Hsiungchun commented 5 years ago

The latest release works. Thanks for your help!