Tapestry 5
  1. Tapestry 5
  2. TAP5-1713

A property expression that generates a list can not reference public static field

    Details

      Description

      So in my template,

      context="[ foo, bar ]"

      And in my code:

      public static Foo FOO = Foo.FOO; // Foo is an enum type

      This fails:

      java.lang.IncompatibleClassChangeError

      Expected non-static field com.example.pages.MyPage.FOO

      • org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:59)
      • org.apache.tapestry5.internal.transform.ParameterWorker$3$1.readFromBinding(ParameterWorker.java:254)
      • org.apache.tapestry5.internal.transform.ParameterWorker$3$1.get(ParameterWorker.java:372)
      • com.fivoosh.components.SilkPageLink.getfieldvalue_context(SilkPageLink.java)
      • com.fivoosh.components.SilkPageLink.getContext(SilkPageLink.java)
      • org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:59)
      • org.apache.tapestry5.internal.transform.ParameterWorker$3$1.readFromBinding(ParameterWorker.java:254)
      • org.apache.tapestry5.internal.transform.ParameterWorker$3$1.get(ParameterWorker.java:372)
      • org.apache.tapestry5.corelib.components.PageLink.getfieldvalue_context(PageLink.java)
      • org.apache.tapestry5.corelib.components.PageLink.beginRender(PageLink.java:57)
      • org.apache.tapestry5.corelib.components.PageLink.beginRender(PageLink.java)
      • org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.invokeComponent(ComponentPageElementImpl.java:202)
      • org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)
      • org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.render(ComponentPageElementImpl.java:209)

      Replacing the field with:

      public Foo getFoo()

      { return Foo.FOO ; }

      works. There's the workaround, anyway.

        Activity

        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #598 (See https://builds.apache.org/job/tapestry-trunk-freestyle/598/)
        TAP5-1713: Add (inefficient) fix for case where the field is static
        TAP5-1713: Create failing test case for bug

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1187422
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1187421
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImplTest.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #598 (See https://builds.apache.org/job/tapestry-trunk-freestyle/598/ ) TAP5-1713 : Add (inefficient) fix for case where the field is static TAP5-1713 : Create failing test case for bug hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1187422 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1187421 Files : /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImplTest.java

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development