Bug 59271 - Regression: Formula parsing fails after update to poi 3.13 if formula contains spaces between closing brackets
Summary: Regression: Formula parsing fails after update to poi 3.13 if formula contain...
Status: RESOLVED DUPLICATE of bug 58648
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.13-FINAL
Hardware: PC All
: P2 regression (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-04 14:59 UTC by Kai G
Modified: 2016-04-04 19:24 UTC (History)
1 user (show)



Attachments
testcase to reproduce the issue (2.57 KB, text/x-csrc)
2016-04-04 15:06 UTC, Kai G
Details
excel testcase used for the unit test (8.98 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-04-04 15:07 UTC, Kai G
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai G 2016-04-04 14:59:26 UTC
The following formula works fine in poi 3.12 but does no longer work with poi 3.13 or 3.14

The error that we are getting with 3.13 is the following

Caused by: org.apache.poi.ss.formula.FormulaParseException: Parse error near char 71 ')' in specified formula '(VLOOKUP("item1", A2:B3, 2, FALSE) - VLOOKUP("item2", A2:B3, 2, FALSE) )'. Expected cell ref or constant literal
	at org.apache.poi.ss.formula.FormulaParser.expected(FormulaParser.java:208)
	at org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1148)
	at org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1103)
	at org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1090)
	at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1450)
	at org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1570)
	at org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1554)
	at org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1511)
	at org.apache.poi.ss.formula.FormulaParser.intersectionExpression(FormulaParser.java:1499)
	at org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1472)
	at org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1131)
	at org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1103)
	at org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1090)
	at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1450)
	at org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1570)
	at org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1554)
	at org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1511)
	at org.apache.poi.ss.formula.FormulaParser.intersectionExpression(FormulaParser.java:1492)
	at org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1472)
	at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1612)
	at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:153)
	at org.apache.poi.xssf.usermodel.XSSFEvaluationWorkbook.getFormulaTokens(XSSFEvaluationWorkbook.java:53)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:261)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:205)
	at org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue(BaseXSSFFormulaEvaluator.java:189)
	at org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCell(BaseXSSFFormulaEvaluator.java:117)

I've attached an excel file and a unit test to reproduce the bug. I guess that this is the same issue as https://bz.apache.org/bugzilla/show_bug.cgi?id=58648
Comment 1 Kai G 2016-04-04 15:06:53 UTC
Created attachment 33723 [details]
testcase to reproduce the issue
Comment 2 Kai G 2016-04-04 15:07:19 UTC
Created attachment 33724 [details]
excel testcase used for the unit test
Comment 3 Dominik Stadler 2016-04-04 19:24:19 UTC
Looks very much like a duplicate of bug 58648.

It's better to try to help fix it there if you can provide more information or even a patch instead of creating a new bug entry.

*** This bug has been marked as a duplicate of bug 58648 ***