Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4688

A null parameter passed to a global command causes ClassCastException

XMLWordPrintable

      Steps to Reproduce


      1. run the attached example
      2. click the button

      Current Result

      SEVERE: 
      java.lang.ClassCastException: class java.lang.Integer cannot be converted to class java.util.Locale.
      	at org.zkoss.lang.Classes.coerce(Classes.java:1449)
      	at org.zkoss.bind.impl.ParamCall.resolveParameter0(ParamCall.java:259)
      	at org.zkoss.bind.impl.ParamCall.resolvePositionalParameter(ParamCall.java:230)
      	at org.zkoss.bind.impl.ParamCall.resolveParameter(ParamCall.java:212)
      	at org.zkoss.bind.impl.ParamCall.call(ParamCall.java:154)
      	at org.zkoss.bind.impl.BinderImpl.handleNotifyChange(BinderImpl.java:1911)
      	at org.zkoss.bind.impl.BinderImpl.doGlobalCommandExecute(BinderImpl.java:1872)
      	at org.zkoss.bind.impl.BinderImpl.doGlobalCommand(BinderImpl.java:1841)
      	at org.zkoss.bind.impl.BinderImpl.access$500(BinderImpl.java:137)
      	at org.zkoss.bind.impl.BinderImpl$QueueListener.onEvent(BinderImpl.java:417)
      	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.execUpdate(UiEngineImpl.java:1329)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:570)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:450)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:458)
      	...
      Caused by: java.lang.NoSuchMethodException: java.util.Locale: no constructor for [1]
      	at org.zkoss.lang.Classes.newInstance(Classes.java:100)
      	at org.zkoss.lang.Classes.coerce(Classes.java:1445)
      	... 45 more
      
      

      Expected Result

      print those parameters in the console without errors

      Debug Information

      • 9.1.0 doesn' have this error.

      Workaround

      don't pass a null parameter.

            DevChu DevChu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: