Uploaded image for project: 'Keikai'
  1. Keikai
  2. KEIKAI-315

Importer fails with valid cell names - Edge case name like cell reference out of sheet limits

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Normal Normal
    • 5.4.0
    • 5.3.0
    • None
    • None

      Steps to Reproduce

      Run attached file in keikai

      File contains a named ranged using a format such as:

      [letter][number higher than 2147483647]

      Current Result

      HTTP ERROR 500 io.keikai.importer.ImportException: Fail to import named range in sheet Sheet1 from book 3-nameoverflow-row.xlsx

      URI: /tutorial/editor.zul
      STATUS: 500
      MESSAGE: io.keikai.importer.ImportException: Fail to import named range in sheet Sheet1 from book 3-nameoverflow-row.xlsx
      SERVLET: DHtmlLayoutServlet
      CAUSED BY: io.keikai.importer.ImportException: Fail to import named range in sheet Sheet1 from book 3-nameoverflow-row.xlsx
      CAUSED BY: io.keikai.model.InvalidModelOpException: name 'A123123123123123123123123' is not legal: cannot be a cell reference

      Caused by:

      io.keikai.importer.ImportException: Fail to import named range in sheet Sheet1 from book 3-nameoverflow-row.xlsx at io.keikai.importer.XlsxImporter.imports(XlsxImporter.java:319) at io.keikai.range.impl.imexp.ExcelImportAdapter.imports(ExcelImportAdapter.java:48) at io.keikai.range.impl.imexp.AbstractImporter.imports(AbstractImporter.java:57) at io.keikai.ui.Spreadsheet.getSBook(Spreadsheet.java:649) at io.keikai.ui.Spreadsheet.getSelectedSSheet(Spreadsheet.java:828) at io.keikai.ui.Spreadsheet.doInvalidate(Spreadsheet.java:2546) at io.keikai.ui.Spreadsheet.invalidate(Spreadsheet.java:2403) at io.keikai.ui.Spreadsheet.setSrc(Spreadsheet.java:877)

      Expected Result

      works in excel

      Debug Information

      The named range parser checks if the named range is a cell name (cannot be both a cell reference and a named range)

      There is a mechanism to check if the named range "row index" is bigger than the possible max value for Excel row number, but it is stored in and Integer which underflow if the number part is > 2147483647 causing the reference to be incorrectly identified as a valid cell.

      Workaround

      Do not use a name using pattern [letters][number > 2147483647]

       

            hawk hawk
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: