Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1386

PropertyResolverImpl.setProperty lacks usefull error mesage if write method not found

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1.5-SNAPSHOT
    • 1.1.5
    • None
    • None

    Description

      my managed bean was lacking a setter for a property. Due to a non-descriptive error message I was unable to identify the source of the problem. After debugging, this code block was identified that lacks a descriptive error message.

      Error message was:
      Bean: com.somedomain.Controller, property: alertDiffResult Bean: com.somedomain.Controller, property: alertDiffResult

      Error message should be:
      Bean: com.somedomain.Controller, property: alertDiffResult Bean: com.somedomain.Controller, property: alertDiffResult (no write method for property)

      suggested patch:

      public static void setProperty(Object base, String name, Object newValue)
      {
      PropertyDescriptor propertyDescriptor =
      getPropertyDescriptor(base, name);

      Method m = propertyDescriptor.getWriteMethod();
      if (m == null)

      { throw new PropertyNotFoundException( getMessage(base, name)+ " (no write method for property!)"); }

      ...

      Attachments

        Activity

          People

            Unassigned Unassigned
            rbri Ronald Brill
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: