Bug 48269 - [PATCH] Exception occurs while try getErrorCellString() from XSSFCell
Summary: [PATCH] Exception occurs while try getErrorCellString() from XSSFCell
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-24 00:38 UTC by Petr.Udalau
Modified: 2009-11-25 03:33 UTC (History)
0 users



Attachments
Fix. (1.66 KB, text/plain)
2009-11-24 00:48 UTC, Petr.Udalau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr.Udalau 2009-11-24 00:38:46 UTC
When we try get error code from the cell with contains formula that returns Error we get exception:
java.lang.IllegalStateException: Cannot get a error value from a formula cell
	at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:781)
	at org.apache.poi.xssf.usermodel.XSSFCell.getErrorCellString(XSSFCell.java:580)
	at org.apache.poi.xssf.usermodel.XSSFCell.getErrorCellValue(XSSFCell.java:596)


It is caused by wrong type identification in method getErrorCellString().

Solution for this problem and simle test see in attachment.
Comment 1 Petr.Udalau 2009-11-24 00:48:05 UTC
Created attachment 24601 [details]
Fix.
Comment 2 Nick Burch 2009-11-25 03:33:30 UTC
Thanks for this, applied to trunk in r884058.