Bug 61063

Summary: Use of arrays of values leads to non empty stack
Product: POI Reporter: Mathis <smear1>
Component: POI OverallAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.16-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Very simple example with rank function

Description Mathis 2017-05-03 13:40:05 UTC
Created attachment 34971 [details]
Very simple example with rank function

When a cell contains a formula with an array of values, the evaluation of the cell is not completed and an exception is thrown.

Here is an example formula: =RANK(A3;(B1;B4;B6);1) (Please see attachment)

Exception in thread "main" java.lang.IllegalStateException: evaluation stack not empty
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:539)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:290)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:232)
	at org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue(BaseXSSFFormulaEvaluator.java:65)
	at org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluate(BaseFormulaEvaluator.java:101)
Comment 1 Dominik Stadler 2017-05-22 20:47:37 UTC
Initial assessment: The list of values as 2nd argument is not supported right now and thus leads to this exception. We likely need some new handling of the resulting UnionPtgs in WorkbookEvaluator.evaluateFormula()
Comment 2 Dominik Stadler 2017-05-23 22:14:11 UTC
This should be fixed in r1795963, there may be other functions where this is not yet fully supported, but I could not yet find a description of where else it is possible to specify a list of references, if you happen to find one, please open a separate bug so we can try to implement it there as well.