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

Incorrect formula throws an exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.6.0
    • 2.6.0
    • ZSS Component
    • Security Level: Jean
    • ZK Spreadsheet FL 0115 and also can reproduce with 0221 FL

      If you type an incorrect for,ula for eg. =sum(d) in a cell ZSS shows a messagebox with exception message such as Ünknown exception: java.util.EmptyStackException

      Steps to reproduce

      1. download and deploy zssee-app-eval-2.6.0-FL-2014-01-15 war file
      2. open zssapp index page
      3. create a new book by clicking File >> New
      4. Enter wrong formula in any cell for eg. =sum(d)

      Expected:
      The cell should show #NAME?

      Actual:
      A ZK message box with Ünknown exception: java.util.EmptyStackException is shown.

      SEVERE: >>java.util.EmptyStackException
      >> at java.util.Stack.peek(Unknown Source)
      >> at java.util.Stack.pop(Unknown Source)
      >> at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:561)
      >> at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:313)
      >> at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:252)
      >> at org.zkoss.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCellValue(HSSFFormulaEvaluator.java:357)
      >> at org.zkoss.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluate(HSSFFormulaEvaluator.java:188)
      >> at org.zkoss.zss.model.impl.BookHelper.evaluate(BookHelper.java:471)
      >> at org.zkoss.zss.model.impl.BookHelper.reevaluate(BookHelper.java:303)
      >> at org.zkoss.zss.model.impl.BookHelper.reevaluateAndNotify(BookHelper.java:457)
      >> at org.zkoss.zss.model.impl.RangeImpl.reevaluateAndNotify(RangeImpl.java:421)
      >> at org.zkoss.zss.model.impl.RangeImpl.setEditText(RangeImpl.java:385)
      >> at org.zkoss.zss.ui.impl.Utils.setEditText(Utils.java:914)
      >> at org.zkoss.zss.ui.impl.Utils.setEditText(Utils.java:904)
      >> at org.zkoss.zss.ui.impl.Utils.setEditTextWithValidation(Utils.java:1240)
      >> at org.zkoss.zss.ui.Spreadsheet.processStopEditing0(Spreadsheet.java:4386)

      Note:

      1. Also happens if you open swineflu.xls file from zssapp and enter wrong formula in it.
      2. Does not have this issue in all cases. For eg. the exception was not raised for attached testFunc.xls file either while importing or manual editing cell value to wrong formula
      3. Can also be reproduced with ZSS 2.6 FL 0221 but can not reproduce with ZSS 3.0.1

        1. testFunc.xls
          37 kB
          ashishd
        2. Wrong_formula_stack_trace.txt
          4 kB
          ashishd

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

              Created:
              Updated:
              Resolved: