diff options
author | Elliott Hughes <enh@google.com> | 2013-07-11 20:51:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-07-11 20:51:26 +0000 |
commit | 3f3fdd79f12292bd0e6dd484732d299ee6df0f09 (patch) | |
tree | 0bc4e46c5e7d67c8b65b6b2bab394dca61f2920a | |
parent | 04371b44f6fea50e0e6bb5c732e36f084f07e8a7 (diff) | |
parent | f2e59ad7786f9c80155e24f17e2c8bc63f8fb22c (diff) | |
download | libcore-3f3fdd79f12292bd0e6dd484732d299ee6df0f09.zip libcore-3f3fdd79f12292bd0e6dd484732d299ee6df0f09.tar.gz libcore-3f3fdd79f12292bd0e6dd484732d299ee6df0f09.tar.bz2 |
Merge "Fix Class.getMethod docs."
-rw-r--r-- | libdvm/src/main/java/java/lang/Class.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libdvm/src/main/java/java/lang/Class.java b/libdvm/src/main/java/java/lang/Class.java index f618b66..47addea 100644 --- a/libdvm/src/main/java/java/lang/Class.java +++ b/libdvm/src/main/java/java/lang/Class.java @@ -388,9 +388,11 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe * constructor matching the given parameter types. * {@code (Class[]) null} is equivalent to the empty array. * + * <p>See {@link #getMethod} for details of the search order. + * Use {@link #getDeclaredConstructor} if you don't want to search superclasses. + * * @throws NoSuchMethodException * if the constructor can not be found. - * @see #getDeclaredConstructor(Class[]) */ @SuppressWarnings("unchecked") public Constructor<T> getConstructor(Class<?>... parameterTypes) throws NoSuchMethodException { @@ -502,9 +504,10 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe * represented by this {@code Class}. * {@code (Class[]) null} is equivalent to the empty array. * + * <p>Use {@link #getConstructor} if you want to search superclasses. + * * @throws NoSuchMethodException * if the requested constructor can not be found. - * @see #getConstructor(Class[]) */ @SuppressWarnings("unchecked") public Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes) @@ -578,11 +581,12 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe * represented by this {@code Class}. * {@code (Class[]) null} is equivalent to the empty array. * + * <p>See {@link #getMethod} if you want to search superclasses. + * * @throws NoSuchMethodException * if the requested method can not be found. * @throws NullPointerException * if {@code name} is {@code null}. - * @see #getMethod(String, Class[]) */ public Method getDeclaredMethod(String name, Class<?>... parameterTypes) throws NoSuchMethodException { @@ -774,14 +778,15 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe * Returns a {@code Method} object which represents the public method with * the given name and parameter types. * {@code (Class[]) null} is equivalent to the empty array. - * This method first searches the - * class C represented by this {@code Class}, then the superclasses of C and - * finally the interfaces implemented by C and finally the superclasses of C - * for a method with matching name. + * + * <p>This method first searches the class C represented by this {@code Class}, + * then the superclasses of C, + * and finally the interfaces implemented by C and its superclasses. + * + * <p>Use {@link #getDeclaredMethod} if you don't want to search superclasses. * * @throws NoSuchMethodException * if the method can not be found. - * @see #getDeclaredMethod(String, Class[]) */ public Method getMethod(String name, Class<?>... parameterTypes) throws NoSuchMethodException { Member member = getConstructorOrMethod(name, true, true, parameterTypes); |