While evaluating Cell.Java (which works great by the way!), I stumbled across the following issue:
Within my application I reset a cells formula via .setFormula(null), but this change also affects it’s neighbor cell. This only happened under certain conditions, but after some hours I was able to isolate the effect.
This effect occurs only if i get the value of an empty cell in the same row, but only if this empty cell is left of the other cells. It’s hard to explain, so please see the following minimal testcase:
public static void main(String[] args) throws Exception
{
Workbook wb = new Workbook();
Worksheet sheet = wb.getWorksheets().get(0);
Cells cells = sheet.getCells();
Row row= cells.getRows().get(1);
row.get(2).setFormula("=1=1");
row.get(3).setFormula("=1=2");
Cell aCell = row.get(2);
Cell bCell = row.get(3);
// uncomment this line in see the effect
// row.get(1).getStringValue();
bCell.setFormula(null);
System.out.println( aCell.getFormula()); //<-- this should be "=1=1"
}
If you uncomment the line containing “getStringValue()” you’ll receive “null” instead of the fomular. It doesn’t happen if you request the value of a cell of index 3 or up.
Tested with cell.java version 20.6, 19.12 and 19.10, all versions behave the same.
Can you confirm this is a bug?