https://bz.apache.org/bugzilla/show_bug.cgi?id=69646
Bug ID: 69646
Summary: NullPointerException in SheetDataWriter.dispose
Product: POI
Version: 5.4.0-FINAL
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: SXSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
We have a situation where we get a NullPointerException in
SheetDataWriter.dispose(), because our SheetDataWriter was created with the
constructor that takes a Writer:
public SheetDataWriter(Writer writer) throws IOException {
_fd = null;
_out = writer;
}
Note that in this case, _fd is null.
Later, SheetDataWriter.dispose() uses _fd without checking for null:
try {
_out.close();
} finally {
ret = _fd.delete();
}
This occurs with POI 5.3.0, 5.4.0 and 5.4.1, but does not occur with 5.2.5. I
think that when https://bz.apache.org/bugzilla/show_bug.cgi?id=68183 was fixed,
a call to dispose() was added to SXSSFWorkbook.
Here is more of the stack trace:
Caused by: java.lang.NullPointerException
Message: Cannot invoke "java.io.File.delete()" because "this._fd" is null
20: at
org.apache.poi.xssf.streaming.SheetDataWriter.dispose(SheetDataWriter.java:466)
19: at
org.apache.poi.xssf.streaming.SXSSFSheet.dispose(SXSSFSheet.java:1991)
18: at
org.apache.poi.xssf.streaming.SXSSFWorkbook.dispose(SXSSFWorkbook.java:1025)
17: at
org.apache.poi.xssf.streaming.SXSSFWorkbook.close(SXSSFWorkbook.java:934)
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]