Bug 55195 - [PATCH] MultiOperandNumericFunction.collectValue() currently uses concrete final classes but should use interfaces instead
[PATCH] MultiOperandNumericFunction.collectValue() currently uses concrete fi...
Status: RESOLVED FIXED
Product: POI
Classification: Unclassified
Component: HSSF
3.9-FINAL
PC Mac OS X 10.4
: P2 normal (vote)
: ---
Assigned To: POI Developers List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-07-04 02:19 UTC by malfree
Modified: 2013-08-12 20:31 UTC (History)
0 users



Attachments
patch file (1.68 KB, application/x-gzip)
2013-07-05 01:57 UTC, malfree
Details

Note You need to log in before you can comment on or make changes to this bug.
Description malfree 2013-07-04 02:19:35 UTC
Currently:
if (ve instanceof NumberEval) {
	NumberEval ne = (NumberEval) ve;
	temp.add(ne.getNumberValue());
	return;
}

Instead, it should be:
if (ve instanceof NumericValueEval) {
	NumericValueEval ne = (NumericValueEval) ve;
	temp.add(ne.getNumberValue());
	return;
}

Same is true for StringEval vs. StringValueEval.

While the current approach technically works, it provides no ability to provide custom implementations of return values from user defined functions.
Comment 1 malfree 2013-07-04 02:29:57 UTC
Add HSSFFormulaEvaluator.evaluateFormulaCellValue() to the list as well
Comment 2 Nick Burch 2013-07-04 09:22:23 UTC
Are you able to produce a patch of the changes needed?
Comment 3 malfree 2013-07-05 01:57:05 UTC
Created attachment 30534 [details]
patch file
Comment 4 Dominik Stadler 2013-08-12 20:31:06 UTC
Applied, thanks for the patch.