Summary: | Sumif throws NullPointerException | ||
---|---|---|---|
Product: | POI | Reporter: | Yoshihiro Kameda <kameda.sbng> |
Component: | SS Common | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | czamarth |
Priority: | P2 | ||
Version: | 3.10-FINAL | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 60858 | ||
Attachments: | for bug 56420 |
Description
Yoshihiro Kameda
2014-04-17 02:58:33 UTC
Can you please share either a file that triggers the problem, or the steps (ideally as a junit test case) to create one that does? I've got the same issu. I add the attachment "test.xlsx", where you can find : __|__A__|__B__|__C__|__D__|__...__| _1|a | 1| | | | _2|b | 2| | | | _3| | | 0| | | _4|d | 3| | | | _5| | | | | | The formula is in C3 : =SUMIF($A$1:$A$4;A3;$B$1:$B$4) He here is the code to get the NullPointerException : private static void POI_sumif() throws IOException { Workbook wb = new XSSFWorkbook(new FileInputStream(new File("C:/Temp/test.xlsx"))); FormulaEvaluator evaluator = wb.getCreationHelper() .createFormulaEvaluator(); try { Cell c = wb.getSheetAt(0).getRow(2).getCell(2); System.out.println(c.getCellFormula()); evaluator.evaluateInCell(c); } catch (Exception e) { e.printStackTrace(); } } Created attachment 31783 [details] for bug 56420 Thanks for the file. In r1607661 I've added a unit test for this problem The test is currently disabled though, as the bug exists... Would be great if someone could now use the unit test to dig into the formula code, and see why the problem is happening... |