4 Replies Latest reply on Feb 20, 2006 3:04 PM by Tom Baeyens

    BeanInstantiator problem

    James Depoorter Novice

      Somewhere in the BeanInstantiator, there is the following code:

       // create the setter method name from the property name
       String setterMethodName = "set"+propertyName.substring(0,1).toUpperCase()+propertyName.substring(1);
       // find the setter method
       Method[] methods = clazz.getDeclaredMethods();

      The getDeclardMethods only returns the methods defined in the class itself, it does not take into account methods of the superclass. This gives problems if you want to make a base class with some general properties, and use a subclass. It will not find the general properties (i.e. setters).
      Is there a special reason for this behaviour?