Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2495

NullPointerException in EnumSelectModel for invalid PropertyModel

    Details

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

      Description

      This can be reproduced with the following code snippet:

          Class c = String.class;
          new EnumSelectModel(c, new MapMessages(Locale.US, Collections.emptyMap()));
      

      It happens in org.apache.tapestry5.corelib.pages.PropertyEditBlocks.getSelectModelForProperty() if a PropertyModel has an enum datatype but the PropertyConduit returns a non-enum class from its getPropertyType() method.
      Of course, that's a user error, but we should be nice and report a better exception.
      There should be checks in EnumSelectModel as well as in PropertyEditBlocks.

        Attachments

          Activity

            People

            • Assignee:
              jkemnade Jochen Kemnade
              Reporter:
              jkemnade Jochen Kemnade
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: