excel-streaming-reader icon indicating copy to clipboard operation
excel-streaming-reader copied to clipboard

StreamingWorkbook throws MissingSheetException when sheet is absent

Open niceman-zz opened this issue 8 years ago • 4 comments

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!

niceman-zz avatar Nov 02 '17 13:11 niceman-zz

+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?

wideocean avatar Nov 07 '17 23:11 wideocean

It certainly could do that, but it would be a change in behavior that I'd say would require a major version bump.

monitorjbl avatar Dec 01 '17 18:12 monitorjbl

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.

maybeec avatar Jan 09 '19 16:01 maybeec

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

joaoFelix avatar Jul 02 '21 14:07 joaoFelix