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

2 double quotes cause an ArrayIndexOutOfBoundsException in a specific formula length

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • 5.6.0
    • 5.5.0
    • None
    • Security Level: Jimmy
    • None
    • None

      Steps to Reproduce

      1. load a new, blank book
      2. enter ="12345678901234567890"&B1&"""aaaClaim Reporting 123456123"" " at A1, no error
      3. enter ="12345678901234567890"&B1&"""aaaClaim 123456123"" " at A2
      Just remove Reporting

      Current Result

      SEVERE: null when parsing "12345678901234567890"&B1&"""aaaClaim 123456123"" " at [New Book.xlsx]Sheet1!Cell:A2[1,0]
      java.lang.ArrayIndexOutOfBoundsException
      at java.lang.System.arraycopy(Native Method)
      at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:597)
      at java.lang.StringBuilder.append(StringBuilder.java:190)
      at org.zkoss.poi.ss.formula.FormulaTokenParser._appendString(FormulaTokenParser.java:1127)
      at org.zkoss.poi.ss.formula.FormulaTokenParser._parseToken(FormulaTokenParser.java:214)
      at org.zkoss.poi.ss.formula.FormulaTokenParser.parse(FormulaTokenParser.java:152)
      at org.zkoss.poi.ss.formula.FormulaTokenParser.parse(FormulaTokenParser.java:139)
      at io.keikaiex.formula.FormulaEngineEx.parse(FormulaEngineEx.java:84)
      at io.keikai.model.impl.sys.formula.FormulaEngineImpl.parse0(FormulaEngineImpl.java:229)
      at io.keikai.model.impl.sys.formula.FormulaEngineImpl.parse(FormulaEngineImpl.java:187)
      at io.keikai.model.impl.CellImpl.setFormulaValue(CellImpl.java:272)
      at io.keikai.range.impl.RangeImpl$7.visit(RangeImpl.java:530)
      at io.keikai.range.impl.RangeImpl.travelCells(RangeImpl.java:265)
      at io.keikai.range.impl.RangeImpl.access$000(RangeImpl.java:109)
      at io.keikai.range.impl.RangeImpl$CellVisitorTask.invoke(RangeImpl.java:180)
      at io.keikai.model.util.ReadWriteTask.doInWriteLock(ReadWriteTask.java:43)
      at io.keikai.range.impl.RangeImpl.setEditText(RangeImpl.java:569)
      at io.keikai.api.impl.RangeImpl.setCellEditText(RangeImpl.java:563)
      at io.keikai.ui.impl.undo.CellEditTextAction.applyAction(CellEditTextAction.java:58)
      at io.keikai.ui.impl.undo.AbstractEditTextAction.doAction(AbstractEditTextAction.java:94)
      at io.keikaiex.ui.impl.UndoableActionManagerImpl.doAction(UndoableActionManagerImpl.java:51)
      at io.keikai.ui.Spreadsheet.processStopEditing0(Spreadsheet.java:2907)
      at io.keikai.ui.Spreadsheet.processStopEditing(Spreadsheet.java:2849)
      at io.keikai.ui.Spreadsheet.access$100(Spreadsheet.java:195)
      at io.keikai.ui.Spreadsheet$2.onEvent(Spreadsheet.java:440)
      at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3184)
      at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3154)
      at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3096)
      at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
      at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1890)
      at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1662)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1329)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:487)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:495)
      ...

      java.lang.ArrayIndexOutOfBoundsException
      at java.lang.System.arraycopy(Native Method)
      at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:597)
      at java.lang.StringBuilder.append(StringBuilder.java:190)
      at org.zkoss.poi.ss.formula.FormulaTokenParser._appendString(FormulaTokenParser.java:1127)
      at org.zkoss.poi.ss.formula.FormulaTokenParser._parseToken(FormulaTokenParser.java:214)
      at org.zkoss.poi.ss.formula.FormulaTokenParser.parse(FormulaTokenParser.java:152)
      at org.zkoss.poi.ss.formula.FormulaTokenParser.parse(FormulaTokenParser.java:139)
      at io.keikaiex.formula.FormulaEngineEx.parse(FormulaEngineEx.java:84)
      at io.keikai.model.impl.sys.formula.FormulaEngineImpl.parse0(FormulaEngineImpl.java:229)
      at io.keikai.model.impl.sys.formula.FormulaEngineImpl.parse(FormulaEngineImpl.java:187)
      at io.keikai.model.impl.CellImpl.setFormulaValue(CellImpl.java:272)
      at io.keikai.range.impl.RangeImpl$7.visit(RangeImpl.java:530)
      at io.keikai.range.impl.RangeImpl.travelCells(RangeImpl.java:265)
      at io.keikai.range.impl.RangeImpl.access$000(RangeImpl.java:109)
      at io.keikai.range.impl.RangeImpl$CellVisitorTask.invoke(RangeImpl.java:180)
      at io.keikai.model.util.ReadWriteTask.doInWriteLock(ReadWriteTask.java:43)
      at io.keikai.range.impl.RangeImpl.setEditText(RangeImpl.java:569)
      at io.keikai.api.impl.RangeImpl.setCellEditText(RangeImpl.java:563)
      at io.keikai.ui.impl.undo.CellEditTextAction.applyAction(CellEditTextAction.java:58)
      at io.keikai.ui.impl.undo.AbstractEditTextAction.doAction(AbstractEditTextAction.java:94)
      at io.keikaiex.ui.impl.UndoableActionManagerImpl.doAction(UndoableActionManagerImpl.java:51)
      at io.keikai.ui.Spreadsheet.processStopEditing0(Spreadsheet.java:2907)
      at io.keikai.ui.Spreadsheet.processStopEditing(Spreadsheet.java:2849)
      at io.keikai.ui.Spreadsheet.access$100(Spreadsheet.java:195)
      at io.keikai.ui.Spreadsheet$2.onEvent(Spreadsheet.java:440)
      at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3184)
      at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3154)
      at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3096)
      at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
      at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1890)
      at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1662)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1329)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:487)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:495)
      ...

      Expected Result

      no error

      Workaround

      use single quote

            jumperchen jumperchen
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: