Project

General

Profile

Bug #5357

SPREADSHEET widget abends with invalid format

Added by Hynek Cihlar about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:

History

#1 Updated by Hynek Cihlar about 3 years ago

On 5/11/21 12:37 AM, Hynek Cihlar wrote:

Hello Jean,

thank you for the update.

We have one issue, which appeared in the customer application. There was an unexpected exception IllegalArgumentException caused by the Keikai's formatting logic. Unfortunately I can't replicate the issue and the only evidence I have is an error message and the related call stack from the time the error happened:

WARNING: Invalid format: " [RED] -##,###,##0.00"
java.lang.IllegalArgumentException: Illegal pattern character 'R'
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:826)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:634)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:605)
at org.zkoss.poi.ss.format.CellDateFormatter.<init>(CellDateFormatter.java:183)
at org.zkoss.poi.ss.format.CellFormatType$3.formatter(CellFormatType.java:53)
at org.zkoss.poi.ss.format.CellFormatPart.getFormatter(CellFormatPart.java:381)
at org.zkoss.poi.ss.format.CellFormatPart.<init>(CellFormatPart.java:206)
at org.zkoss.poi.ss.format.CellFormat.<init>(CellFormat.java:196)
at org.zkoss.poi.ss.format.CellFormat.getInstance(CellFormat.java:172)
at io.keikai.model.impl.sys.FormatEngineImpl.getCellFormat(FormatEngineImpl.java:79)
at io.keikaiex.model.sys.FormatEngineEx.getCellFormat(FormatEngineEx.java:46)
at io.keikai.model.impl.sys.FormatEngineImpl.format0(FormatEngineImpl.java:98)
at io.keikai.model.impl.sys.FormatEngineImpl.format(FormatEngineImpl.java:70)
at io.keikai.ui.impl.CellFormatHelper.getFormatResult(CellFormatHelper.java:1020)
at io.keikai.ui.SpreadsheetCtrlImpl.getCellAttr(SpreadsheetCtrlImpl.java:535)
at io.keikai.ui.SpreadsheetCtrlImpl.getRangeAttrs(SpreadsheetCtrlImpl.java:382)
at io.keikai.ui.Spreadsheet.responseUpdateCell(Spreadsheet.java:2514)
at io.keikai.ui.Spreadsheet.updateCell(Spreadsheet.java:2479)
at io.keikai.ui.InnerModelEventDispatcher.onCellContentChange(InnerModelEventDispatcher.java:228)
at io.keikai.ui.ModelEventDispatcher.onEvent(ModelEventDispatcher.java:45)
at io.keikai.model.impl.EventQueueListenerAdaptor$WrappedListener.onEvent(EventQueueListenerAdaptor.java:106)
at org.zkoss.zk.ui.event.impl.DesktopEventQueue$QueueListener.onEvent(DesktopEventQueue.java:168)
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.endUpdate(UiEngineImpl.java:1230)
at org.zkoss.zkex.ui.comet.CometServerPush.deactivate(CometServerPush.java:535)
at org.zkoss.zk.ui.impl.DesktopImpl.deactivateServerPush(DesktopImpl.java:1648)
at org.zkoss.zk.ui.Executions.deactivate(Executions.java:1011)
at com.goldencode.p2j.ext.sheet.web.SheetControllerImpl.doOnDesktop(SheetControllerImpl.java:3797)

Although the log output above would suggest that the format " [RED] -##,###,##0.00" is invalid, in a simple test case it works OK. By simple test case I mean I can assign this exact format string to a cell using the Keikai API.

Perhaps you have seen this kind of error previously? The Keikai version is 5.7.0.

Thanks,
Hynek

#3 Updated by Hynek Cihlar about 3 years ago

The Keikai ticket for this issue is https://potix.freshdesk.com/support/tickets/12479. They suggest to trim the white spaces from the format string, which should work for us OK.

I checked in the suggested workaround in 3821c revision 12399.

#4 Updated by Hynek Cihlar about 3 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#5 Updated by Greg Shah about 3 years ago

  • Assignee set to Hynek Cihlar
  • Status changed from Feedback to Closed

Also available in: Atom PDF