# HG changeset patch # User jfranck # Date 1386151445 -3600 # Node ID fb9a728c4b77e42728acdd9bb31aa9e901134167 # Parent ba91ccb012e623a4b62dcf04dd2cbac99d7062e2 8029117: (reflect) clarify javadoc for getMethod(...) and getMethods() Reviewed-by: darcy diff -r ba91ccb012e6 -r fb9a728c4b77 jdk/src/share/classes/java/lang/Class.java --- a/jdk/src/share/classes/java/lang/Class.java Wed Dec 04 10:27:50 2013 +0100 +++ b/jdk/src/share/classes/java/lang/Class.java Wed Dec 04 11:04:05 2013 +0100 @@ -1565,8 +1565,12 @@ * methods inherited by the array type from {@code Object}. It does not * contain a {@code Method} object for {@code clone()}. * - *
If this {@code Class} object represents a class or interface with no - * public methods, then the returned array has length 0. + *
If this {@code Class} object represents an interface then the + * returned array does not contain any implicitly declared methods from + * {@code Object}. Therefore, if no methods are explicitly declared in + * this interface or any of its superinterfaces then the returned array + * has length 0. (Note that a {@code Class} object which represents a class + * always has public methods, inherited from {@code Object}.) * *
If this {@code Class} object represents a primitive type or void, * then the returned array has length 0. @@ -1699,25 +1703,29 @@ * order. If {@code parameterTypes} is {@code null}, it is * treated as if it were an empty array. * - *
If the {@code name} is "{@code If the {@code name} is "{@code To find a matching method in a class or interface C: 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.
*
* Note that there may be more than one matching method in a
* class because while the Java language forbids a class to
- *
*
- * To find a matching method in a class C: 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.
+ *
+ *