Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-723

The "empty" property of StringTranslator is broken

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: Framework
    • Labels:
      None

      Description

      When trying to set the empty property for a StringTranslator in an initializer, like this:

      <binding name="translator" value="translator:string,empty=''"/>,

      an exception is thrown:

      org.apache.hivemind.ApplicationRuntimeException: Unable to instantiate instance of class org.apache.tapestry.form.translator.StringTranslator: java.lang.reflect.InvocationTargetException [context:/WEB-INF/EditDoc.page, line 36, column 68]

      ...

      Caused by: org.apache.hivemind.ApplicationRuntimeException: Property empty of object org.apache.tapestry.form.translator.StringTranslator@dad4b8 is read-only.
      at org.apache.hivemind.util.PropertyAdaptor.write(PropertyAdaptor.java:86)
      at org.apache.hivemind.util.PropertyAdaptor.smartWrite(PropertyAdaptor.java:109)
      at org.apache.hivemind.util.ClassAdaptor.smartWrite(ClassAdaptor.java:76)
      at org.apache.hivemind.util.ClassAdaptor.configurePropertyFromToken(ClassAdaptor.java:219)
      at org.apache.hivemind.util.ClassAdaptor.configureProperties(ClassAdaptor.java:195)
      at org.apache.hivemind.util.PropertyUtils.configureProperties(PropertyUtils.java:90)
      at org.apache.tapestry.form.translator.StringTranslator.<init>(StringTranslator.java:43)

      In StringTranslator the type of the "empty" property seems to be mismatched in the getter and setter:

      public Object getEmpty()

      { return _empty; }

      public void setEmpty(String empty)

      { _empty = empty; }

      This is the same problem found here:
      http://www.mail-archive.com/tapestry-user@jakarta.apache.org/msg08166.html

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard Lewis Ship
              Reporter:
              denespal Pal Denes
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: