Bug 51716 - Incorrect assert in SXSSFSheet#getSXSSFSheet(XSSFSheet)
Summary: Incorrect assert in SXSSFSheet#getSXSSFSheet(XSSFSheet)
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 3.8-dev
Hardware: PC All
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 10:42 UTC by Mark Harris
Modified: 2011-10-04 12:36 UTC (History)
0 users



Attachments
Removes an assert from SXSSFWorkbook.java (503 bytes, application/octet-stream)
2011-08-24 10:42 UTC, Mark Harris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Harris 2011-08-24 10:42:34 UTC
Created attachment 27430 [details]
Removes an assert from SXSSFWorkbook.java

Workbook#getSheet(String) explicitly states that it should return null if workbook does not contain a sheet with the name given.

In 3.8-beta3 and the trunk, SXSSFWorkbooks implementation of getSheet(String) calls getSXSSFSheet(XSFFSheet), which contains an assert (:68 in 3.8-beta3) that the result of a Map lookup on the string isn't null.

This makes getSheet(String) no good for an existence check on a named sheet if the JVM has been run with -ea.

I've attached a patch that removes the assert from the current trunk.
Comment 1 Yegor Kozlov 2011-10-04 12:36:51 UTC
Applied in r1178769

Thanks,
Yegor