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

Unpredictable String.replace result in EL expression

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Normal Normal
    • None
    • 6.0.2, 6.5.0
    • General
    • linux, jdk 1.6.0_35

      The expected value of this label

      <label value="${'bye'.replace('bye','ciao')}" />

      is "ciao" but the actual value is "cye".

      On Windows with the same version of jdk we get the expected value.

      After debugging it seems that org.zkoss.zel.BeanELResolver matches the method to invoke using method name and parameters number so getting confused by:

      public String String.replace(CharSequence, CharSequence)

      and

      public String String.replace(Char, Char)

      Since parameters are available we could use

      public Method Class.getMethod(String, Class[])

            MontyPan MontyPan
            benedetti benedetti
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: