Summary: | Function update fails on functions with more than 127 arguments | ||
---|---|---|---|
Product: | POI | Reporter: | wellwishingmax |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | michal |
Priority: | P2 | ||
Version: | 3.13-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
wellwishingmax
2016-02-05 14:31:47 UTC
Ah, sorry, I meant "CONCATENATE(1,2,...125,CONCATENATE(126,127,....x))" in the workaround, as written it would duplicate the 125th value. Excel limits functions to 255 arguments [1] > Calculation specifications and limits > Feature Maximum limit > Arguments in a function 255 POI XSSF should at least be able to support this many function arguments. [1] https://support.office.com/en-us/article/Excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3 128 sounds like a signed byte data type is being used when we should either be using an unsigned byte (unwrap a signed byte) or short. Do you have time to look through the code to try to find where this might be happening? (In reply to Javen O'Neal from comment #2) > Excel limits functions to 255 arguments [1] > > > Calculation specifications and limits > > Feature Maximum limit > > Arguments in a function 255 > > POI XSSF should at least be able to support this many function arguments. > > [1] > https://support.office.com/en-us/article/Excel-specifications-and-limits- > 1672b34d-7043-467e-8e27-269d656771c3 > > 128 sounds like a signed byte data type is being used when we should either > be using an unsigned byte (unwrap a signed byte) or short. > > Do you have time to look through the code to try to find where this might be > happening? At line 99 of FormulaRenderer, the object relating to the formula is cast as an OperationPtg. At line 100, getNumberOfOperands() is called on it. Examining the type hierarchy, getNumberOfOperands() is abstract in OperationPtg, and the only subclass that implements it that doesn't return a constant is AbstractFunctionPtg, which returns _numberOfArgs, a private byte. The constructor sets _numberOfArgs on creation by casting an int argument nParams as a byte. Can you provide sample code which allows to reproduce this? Ideally as standalone unit-test together with any required sample-file? This way we can reproduce it and also ensure that it stays fixed in the future. added test case using https://svn.apache.org/viewvc?view=revision&revision=1801307 Will be included in POI 3.17 beta 2 |