MyFaces Core
  1. MyFaces Core
  2. MYFACES-1386

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.5-SNAPSHOT
    • Fix Version/s: 1.1.5
    • Component/s: None
    • Labels:
      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!)"); }

      ...

        Activity

        Hide
        Mike Kienenberger added a comment -

        Ronald,

        That sounds reasonable.

        Can you submit this in the form of a patch?

        Show
        Mike Kienenberger added a comment - Ronald, That sounds reasonable. Can you submit this in the form of a patch?
        Hide
        Matthias Weßendorf added a comment -

        fixed

        Show
        Matthias Weßendorf added a comment - fixed

          People

          • Assignee:
            Unassigned
            Reporter:
            Ronald Brill
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development