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

PropertyUtils throws misleading exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0 Beta 1
    • 1.0.0
    • Core
    • None
    • Operating System: All
      Platform: PC
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: