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

        Howard M. Lewis Ship created issue -
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        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:

        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.
        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.
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Howard M. Lewis Ship [ hlship ]
        Fix Version/s 5.3 [ 12316024 ]
        Resolution Fixed [ 1 ]

          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