Hidden IOException at isClosed()
Brought to you by:
aruckerjones,
sconway
When a line ends exactly at the end of BufferedReader internal buffer, the CSVReader#isClosed() method one byte reading will refill the buffer, the mark is lost, therefore the reset() throws "java.io.IOException: Mark invalid" exception. This bug aborts further reads from the buffer.
This bug probably introduced by this fix: https://sourceforge.net/p/opencsv/bugs/108/
Here is a complete example use case:
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.List;
import com.opencsv.CSVReader;
public class CSVReaderTest
{
}
I am also facing this issue while parsing big file ~20MB. As complete file is not read, we are losing some data because of this.
Is there any update on this ticket?
Rathiar I apologize but no there has been no updates on this issue. I am
entering in the crazy part of the year with work, kids activities, Boy
Scout troop activities that there will not be much work done for the next
couple of months. I have one feature I am trying to get out before
September and even that I have not touched in a month.
Bardocz - thanks for the example.
I have an question though. Bardocz - you said this issue was caused by
Issue #108. Have either of you tried version 3.4 because there was a fix
to the isClosed in there.
If both of you are using 3.4 I will take the example that Bardocz made and
try and make a unit test out of it. If successful I will try and slate
this for 3.5 but with everything happening this Summer/Fall I cannot give
you a ETA for 3.5.
:(
On Tue, Jul 21, 2015 at 12:07 AM, Anand Rathi rathiar@users.sf.net wrote:
--
Scott Conway
scott.conway@gmail.com
http://www.conwayfamily.name
Related
Bugs:
#115My scenario is working fine with v3.3. So, it seems that this issue is because of changes made in isClosed() method in v3.4
I was afraid of that. I will see if I can get a chance to look at the
isClosed this weekend.
On Mon, Jul 27, 2015 at 11:23 PM, Anand Rathi rathiar@users.sf.net wrote:
--
Scott Conway
scott.conway@gmail.com
http://www.conwayfamily.name
Related
Bugs:
#115Found it! The problem with the isClosed fix is that it was setting a mark of one byte but in Java the size of a character is two bytes.
I do not know why it did not fail immediately but after changing the size passed into the mark I ran the test that Bardocz sent in a loop of 10000 without issue.
I have merged the fix in trunk and will try and get a new version out this weekend if I can get a support request in.
Thanks Scott for quick turnaround. Is it possible to make that fix available in v3.4. I believe without this fix, v3.4 should not be used.
Agreed - I am going to try and push out a new version this weekend and that
will be 3.5. Agreed that 3.4 should not be used but I would rather push a
new version than overwrite a previous version. That way if someone comes
up and says I have a problem with version 3.4 I won't have to ask when they
downloaded it.
On Thu, Jul 30, 2015 at 12:08 AM, Anand Rathi rathiar@users.sf.net wrote:
--
Scott Conway
scott.conway@gmail.com
http://www.conwayfamily.name
Related
Bugs:
#115