excel-streaming-reader
excel-streaming-reader copied to clipboard
StreamingWorkbook throws MissingSheetException when sheet is absent
interface org.apache.poi.ss.usermodel.Workbook states that Sheet getSheet(String name) method must return null if sheet doesn't exist. Why do you throw exception? It's absolutely unexpected behaviour!
+1, totally agree with that. Why throwing an exception for this? It would be nice if it just returns null like in vanilla POI. Is that possible?
It certainly could do that, but it would be a change in behavior that I'd say would require a major version bump.
I think it is not that critical to change it, as the method documentation of getSheet is not satisfied. So actually, this changes the behavior but fixes it as of the specification. For me anybody, who now relies on that getSheet(name) is never null did not make a good job.
The major problema is that the Javadoc states that it inherits the behaviour from the org.apache.poi.ss.usermodel.Workbook.getSheet method, which is clearly wrong and misleading.
Either change the funcionality with a new major release or fix the Javadoc