Bug 62828 - CellReference(Cell) ctor does not initialize sheetName
Summary: CellReference(Cell) ctor does not initialize sheetName
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 4.0.0-FINAL
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks: 63509
  Show dependency tree
 
Reported: 2018-10-15 16:42 UTC by David Gauntt
Modified: 2019-06-20 09:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Gauntt 2018-10-15 16:42:11 UTC
Calling the constructor new CellReference(cell) does not initialize the sheet name.  When the unit test code below is run, the following is written to System.out:

goodCellRef='Ctor test'!$A$1
badCellRef=A1


Unit test code follows:

  private static void cellReferenceCtorTest(XSSFWorkbook workbook) {
    final XSSFSheet sheet = workbook.createSheet("Ctor test");
    final String sheetName = sheet.getSheetName();
    final XSSFRow row = sheet.createRow(0);
    final XSSFCell cell = row.createCell(0);
    final CellReference goodCellRef = new CellReference(sheetName, cell.getRowIndex(), cell.getColumnIndex(), true,
        true);
    final CellReference badCellRef = new CellReference(cell);

    System.out.println(String.format("goodCellRef=%s", goodCellRef.formatAsString()));
    System.out.println(String.format("badCellRef=%s", badCellRef.formatAsString()));
  }
Comment 1 gallon.fizik@gmail.com 2019-01-02 22:11:09 UTC
Fixed via r1850210. Thanks to David Gauntt for the report.