Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-184

PropertyUtils throws misleading exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0 Beta 1
    • Fix Version/s: 1.0.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC
    • Bugzilla Id:
      1785

      Description

      Class org.apache.struts.util.PropertyUtils:

      ...

      public static Object getSimpleProperty(Object bean, String name)
      throws IllegalAccessException, InvocationTargetException,
      NoSuchMethodException {

      // Retrieve the property getter method for the specified property
      PropertyDescriptor descriptor =
      getPropertyDescriptor(bean, name);
      if (descriptor == null)
      throw new NoSuchMethodException("Unknown property '" +
      name + "'");

      ...

      -------------------

      Upon closer inspection, getPropertyDescriptor will return null if the bean is
      null, in which case NoSuchMethodException is rather misleading.

        Attachments

          Activity

            People

            • Assignee:
              craigmcc Craig R. McClanahan
              Reporter:
              stephen_breeser@yahoo.com stephen_breeser
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: