Bug 46053 - Evaluation cache dependency analysis broken when changing blank values
Summary: Evaluation cache dependency analysis broken when changing blank values
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-21 14:15 UTC by Josh Micich
Modified: 2008-11-03 11:36 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Micich 2008-10-21 14:15:13 UTC
The following code demonstrates the problem:

HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("Sheet1");
HSSFRow row = sheet.createRow(0);
HSSFCell cellA1 = row.createCell(0);
HSSFCell cellB1 = row.createCell(1);
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);

cellA1.setCellFormula("B1+2.2");
cellB1.setCellValue(1.5);

fe.notifyUpdateCell(cellA1);
fe.notifyUpdateCell(cellB1);

CellValue cv;
cv = fe.evaluate(cellA1);
assertEquals(3.7, cv.getNumberValue(), 0.0);

cellB1.setCellType(HSSFCell.CELL_TYPE_BLANK);
fe.notifyUpdateCell(cellB1);
cv = fe.evaluate(cellA1);
assertEquals(2.2, cv.getNumberValue(), 0.0);

cellB1.setCellValue(0.4);
fe.notifyUpdateCell(cellB1);
cv = fe.evaluate(cellA1);
if (cv.getNumberValue() == 2.2) {
	throw new AssertionFailedError("Error in evaluation dependency (cached value not reset)");
}
assertEquals(2.6, cv.getNumberValue(), 0.0);
Comment 1 Josh Micich 2008-10-21 14:29:04 UTC
Fixed in svn r706722
Comment 2 Josh Micich 2008-11-03 11:36:02 UTC
(In reply to comment #1)
> Fixed in svn r706722
> 

oops - actually it was svn r706772