Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-562

IllegalArgumentException showed when referencing a Spring bean that contains List type properties

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.5.0
    • Component/s: ZSS Formula
    • Security Level: Jimmy
    • Labels:
      None

      Description

      When a spring bean contains a property which type is List. And enter formula "=bean.list" on cell C3 will show IllegalArgumentException in console.
      Stack trace

      java.lang.IllegalArgumentException: Did not expect to update to null
      	at org.zkoss.poi.ss.formula.CellCacheEntry.updateValue(CellCacheEntry.java:47)
      	at org.zkoss.poi.ss.formula.FormulaCellCacheEntry.updateFormulaResult(FormulaCellCacheEntry.java:108)
      	at org.zkoss.poi.ss.formula.CellEvaluationFrame.updateFormulaResult(CellEvaluationFrame.java:75)
      	at org.zkoss.poi.ss.formula.EvaluationTracker.updateCacheResult(EvaluationTracker.java:94)
      	at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:325)
      	at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:257)
      	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:267)
      	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:120)
      	at org.zkoss.zss.model.sys.impl.BookHelper.evaluate(BookHelper.java:510)
      	at org.zkoss.zss.model.sys.impl.BookHelper.reevaluate(BookHelper.java:326)
      	at org.zkoss.zss.model.sys.impl.BookHelper.reevaluateAndNotify(BookHelper.java:496)
      	at org.zkoss.zss.model.sys.impl.XRangeImpl.reevaluateAndNotify(XRangeImpl.java:443)
      	at org.zkoss.zss.model.sys.impl.XRangeImpl.setEditText(XRangeImpl.java:397)
      	at org.zkoss.zss.api.impl.RangeImpl.setCellEditText(RangeImpl.java:599)
      	at org.zkoss.zss.ui.impl.undo.CellEditTextAction.applyAction(CellEditTextAction.java:51)
      	at org.zkoss.zss.ui.impl.undo.AbstractEditTextAction.doAction(AbstractEditTextAction.java:82)
      	at org.zkoss.zssex.ui.impl.UndoableActionManagerImpl.doAction(UndoableActionManagerImpl.java:50)
      	at org.zkoss.zss.ui.Spreadsheet.processStopEditing0(Spreadsheet.java:4553)
      	at org.zkoss.zss.ui.Spreadsheet.processStopEditing(Spreadsheet.java:4506)
      	at org.zkoss.zss.ui.Spreadsheet.access$300(Spreadsheet.java:197)
      	at org.zkoss.zss.ui.Spreadsheet$2.onEvent(Spreadsheet.java:353)
      	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2743)
      
      1. AssetsBean.java
        2 kB
        vincentjian
      2. bean.xlsx
        10 kB
        vincentjian
      3. RefSpringBeanComposer.java
        2 kB
        vincentjian
      4. springBean.zul
        1 kB
        vincentjian

        Activity

        Hide
        henrichen henrichen added a comment - - edited

        1. This issue has nothing to do with Spring; as long as the type of the evaluated value is not among String, Number, Boolean, Date, it will throw the same exception.
        2. In this case it is out of spec. to set a List into a spreadsheet cell.
        3. Should show #VALUE! to indicate incorrect type of value.

        Show
        henrichen henrichen added a comment - - edited 1. This issue has nothing to do with Spring; as long as the type of the evaluated value is not among String, Number, Boolean, Date, it will throw the same exception. 2. In this case it is out of spec. to set a List into a spreadsheet cell. 3. Should show #VALUE! to indicate incorrect type of value.
        Show
        henrichen henrichen added a comment - 3.5 https://github.com/zkoss/zkspreadsheet/commit/63690e96a1cdc51be7224ba23d2f518c37e08122 https://github.com/zkoss/zsscml/commit/a7233df4bf7f2f030e4de28a9107c3d18a95dd45
        Hide
        henrichen henrichen added a comment -

        Fixed.

        Show
        henrichen henrichen added a comment - Fixed.

          People

          • Assignee:
            Jenkins Jenkins
            Reporter:
            vincentjian vincentjian
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: