Original issue 1261 created by codenameone on 2015-01-07T06:56:43.000Z:
What I've discovered is that on the newVM the inputstream reader seems to not return -1 for the end of the file consistently. When that happens the CSV Parser reads too far into the buffer and returns characters from elsewhere in the file.
This only happens on the newVM. I've made a minimal example which I've attached. It reads each line of the CSV file and checks that ends in 'A' which each row of the CSV file does. If it doesn't end in 'A' it logs an error.
It repeats this 10 times in case it was an issue with opening and closing streams, but the error happens on the first run anyway.
Note that sometimes things will work fine, and some CSV files work all the time, other times it'll fail. In this example my device fails the same way every time its run.
On the simulator, on Android and on the old VM this error never occurs.
Original issue 1261 created by codenameone on 2015-01-07T06:56:43.000Z:
What I've discovered is that on the newVM the inputstream reader seems to not return -1 for the end of the file consistently. When that happens the CSV Parser reads too far into the buffer and returns characters from elsewhere in the file.
This only happens on the newVM. I've made a minimal example which I've attached. It reads each line of the CSV file and checks that ends in 'A' which each row of the CSV file does. If it doesn't end in 'A' it logs an error.
It repeats this 10 times in case it was an issue with opening and closing streams, but the error happens on the first run anyway.
Note that sometimes things will work fine, and some CSV files work all the time, other times it'll fail. In this example my device fails the same way every time its run.
On the simulator, on Android and on the old VM this error never occurs.