Tapestry 5
  1. Tapestry 5
  2. TAP5-1331

EnumValueEncoder should identify legal values when a non-matching string is passed to it for conversion

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.2.3
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      java.lang.IllegalArgumentException
      No enum const class demo.pages.Index$Demo.xyz

      • java.lang.Enum.valueOf(Enum.java:196)
      • org.apache.tapestry5.util.EnumValueEncoder.toValue(EnumValueEncoder.java:46)
      • org.apache.tapestry5.util.EnumValueEncoder.toValue(EnumValueEncoder.java:23)
      • org.apache.tapestry5.internal.services.ContextValueEncoderImpl.toValue(ContextValueEncoderImpl.java:47)
      • $ContextValueEncoder_12bf46d86ac.toValue($ContextValueEncoder_12bf46d86ac.java)
      • org.apache.tapestry5.internal.URLEventContext.get(URLEventContext.java:43)
      • org.apache.tapestry5.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:83)
      • org.apache.tapestry5.internal.transform.PageActivationContextWorker$1.handleEvent(PageActivationContextWorker.java:84)
      • org.apache.tapestry5.internal.services.InternalClassTransformationImpl$11.advise(InternalClassTransformationImpl.java:2384)
      • org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:86)
      • demo.pages.Index.dispatchComponentEvent(Index.groovy)

        Issue Links

          Activity

          Hide
          Howard M. Lewis Ship added a comment -

          Easiest way was to convert it to use TypeCoercer, which already has the logic (and it's nice to unify things that way).

          Show
          Howard M. Lewis Ship added a comment - Easiest way was to convert it to use TypeCoercer, which already has the logic (and it's nice to unify things that way).
          Hide
          Hudson added a comment -

          Integrated in tapestry-trunk-freestyle #537 (See https://builds.apache.org/job/tapestry-trunk-freestyle/537/)
          TAP5-1331: EnumValueEncoder should identify legal values when a non-matching string is passed to it for conversion

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

          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/EnumValueEncoderFactory.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/util/EnumValueEncoder.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PaletteDemo.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/SelectZoneDemo.java
          Show
          Hudson added a comment - Integrated in tapestry-trunk-freestyle #537 (See https://builds.apache.org/job/tapestry-trunk-freestyle/537/ ) TAP5-1331 : EnumValueEncoder should identify legal values when a non-matching string is passed to it for conversion hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1174941 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/EnumValueEncoderFactory.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/util/EnumValueEncoder.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/PaletteDemo.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/SelectZoneDemo.java
          Hide
          Jochen Kemnade added a comment -

          Howard M. Lewis Ship This change has led to another issue: TAP5-2496. What exactly was the problem you wanted to fix here? Can you add a test case?

          Show
          Jochen Kemnade added a comment - Howard M. Lewis Ship This change has led to another issue: TAP5-2496 . What exactly was the problem you wanted to fix here? Can you add a test case?
          Hide
          Jochen Kemnade added a comment -

          Ah, this is just about the exception.

          Show
          Jochen Kemnade added a comment - Ah, this is just about the exception.
          Hide
          ASF subversion and git services added a comment -

          Commit 8d155f91f18d5cd8c8b126c55d41ed3464a29cee in tapestry-5's branch refs/heads/master from Jochen Kemnade
          [ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=8d155f9 ]

          TAP5-1331: add test

          Show
          ASF subversion and git services added a comment - Commit 8d155f91f18d5cd8c8b126c55d41ed3464a29cee in tapestry-5's branch refs/heads/master from Jochen Kemnade [ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=8d155f9 ] TAP5-1331 : add test
          Hide
          Hudson added a comment -

          ABORTED: Integrated in tapestry-trunk-freestyle #1486 (See https://builds.apache.org/job/tapestry-trunk-freestyle/1486/)
          TAP5-1331: add test (jochen.kemnade: rev 8d155f91f18d5cd8c8b126c55d41ed3464a29cee)

          • tapestry-core/src/test/java/org/apache/tapestry5/util/EnumValueEncoderTest.java
          Show
          Hudson added a comment - ABORTED: Integrated in tapestry-trunk-freestyle #1486 (See https://builds.apache.org/job/tapestry-trunk-freestyle/1486/ ) TAP5-1331 : add test (jochen.kemnade: rev 8d155f91f18d5cd8c8b126c55d41ed3464a29cee) tapestry-core/src/test/java/org/apache/tapestry5/util/EnumValueEncoderTest.java

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development