CSVWriter wraps its passed Writer in PrintWriter which has in its Javadoc:
"Methods in this class never throw I/O exceptions. The client may inquire as to whether any errors have occurred by invoking checkError()."
CSVWriter never calls checkError() or similar. I found this bug because I was writing out large CSV files that filled up my /tmp/ - this didn't result in an error at the time, but just left me with partially complete CSV files.
I think CSVWriter should either (A) use a Writer that throws IOException in this case (B) call checkError at some defined point (maybe on every flush?) or (C) provide me with a method to call checkError() on the PrintWriter.
Log in to post a comment.