src/share/classes/java/lang/Class.java

Print this page

        

*** 1563,1574 **** * <p> If this {@code Class} object represents an array type, then the * returned array has a {@code Method} object for each of the public * methods inherited by the array type from {@code Object}. It does not * contain a {@code Method} object for {@code clone()}. * ! * <p> If this {@code Class} object represents a class or interface with no ! * public methods, then the returned array has length 0. * * <p> If this {@code Class} object represents a primitive type or void, * then the returned array has length 0. * * <p> Static methods declared in superinterfaces of the class or interface --- 1563,1577 ---- * <p> If this {@code Class} object represents an array type, then the * returned array has a {@code Method} object for each of the public * methods inherited by the array type from {@code Object}. It does not * contain a {@code Method} object for {@code clone()}. * ! * <p> If this {@code Class} object represents an interface then the ! * returned array does not contain any implicitly declared methods from ! * {@code Object}. If no methods are explicitly declared in this interface ! * or a superinterface then the returned array has length 0. (A class ! * always has public methods inherited from {@code Object}.) * * <p> If this {@code Class} object represents a primitive type or void, * then the returned array has length 0. * * <p> Static methods declared in superinterfaces of the class or interface
*** 1697,1721 **** * {@code parameterTypes} parameter is an array of {@code Class} * objects that identify the method's formal parameter types, in declared * order. If {@code parameterTypes} is {@code null}, it is * treated as if it were an empty array. * ! * <p> If the {@code name} is "{@code <init>};"or "{@code <clinit>}" a * {@code NoSuchMethodException} is raised. Otherwise, the method to * be reflected is determined by the algorithm that follows. Let C be the ! * class represented by this object: * <OL> ! * <LI> C is searched for any <I>matching methods</I>. If no matching ! * method is found, the algorithm of step 1 is invoked recursively on ! * the superclass of C.</LI> ! * <LI> If no method was found in step 1 above, the superinterfaces of C ! * are searched for a matching method. If any such method is found, it ! * is reflected.</LI> * </OL> * ! * To find a matching method in a class C:&nbsp; If C declares exactly one ! * public method with the specified name and exactly the same formal * parameter types, that is the method reflected. If more than one such * method is found in C, and one of these methods has a return type that is * more specific than any of the others, that method is reflected; * otherwise one of the methods is chosen arbitrarily. * --- 1700,1725 ---- * {@code parameterTypes} parameter is an array of {@code Class} * objects that identify the method's formal parameter types, in declared * order. If {@code parameterTypes} is {@code null}, it is * treated as if it were an empty array. * ! * <p> If the {@code name} is "{@code <init>}" or "{@code <clinit>}" a * {@code NoSuchMethodException} is raised. Otherwise, the method to * be reflected is determined by the algorithm that follows. Let C be the ! * class or interface represented by this object: * <OL> ! * <LI> C is searched for a <I>matching methods</I>, as defined below. If a ! * matching method is found, it is reflected.</LI> ! * <LI> If no matching method is found in step 1 and C is a class, then ! * step 1 is invoked recursively on the superclass of C.</LI> ! * <LI> If C is an interface, or if no method was found in step 1 or 2 ! * above, the superinterfaces of C are searched for a matching ! * method. If any such method is found, it is reflected.</LI> * </OL> * ! * <p>To find a matching method in a class C:&nbsp; If C declares exactly ! * one public method with the specified name and exactly the same formal * parameter types, that is the method reflected. If more than one such * method is found in C, and one of these methods has a return type that is * more specific than any of the others, that method is reflected; * otherwise one of the methods is chosen arbitrarily. *