From 1b7cda0fc609d9ebb21ed3e4179ce09927acb494 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 21 Apr 2015 18:03:08 -0700 Subject: Add missing @hide and fix Constructor + Method changing API Change-Id: I9f68c96b4ddf7e8c004a3209fcc04fb371fb014a --- .../src/main/java/java/lang/reflect/AbstractMethod.java | 15 ++++++++++----- libart/src/main/java/java/lang/reflect/Constructor.java | 3 ++- libart/src/main/java/java/lang/reflect/Method.java | 3 ++- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'libart') diff --git a/libart/src/main/java/java/lang/reflect/AbstractMethod.java b/libart/src/main/java/java/lang/reflect/AbstractMethod.java index aa5df0c..0ac15f9 100644 --- a/libart/src/main/java/java/lang/reflect/AbstractMethod.java +++ b/libart/src/main/java/java/lang/reflect/AbstractMethod.java @@ -49,7 +49,11 @@ public abstract class AbstractMethod extends AccessibleObject { /** Bits encoding access (e.g. public, private) as well as other runtime specific flags */ protected int accessFlags; - /** The ArtMethod associated with this Method, requried for dispatching due to entrypoints */ + /** + * The ArtMethod associated with this Method, requried for dispatching due to entrypoints + * Hidden to workaround b/16828157. + * @hide + */ protected ArtMethod artMethod; /** Method's declaring class */ @@ -62,6 +66,10 @@ public abstract class AbstractMethod extends AccessibleObject { /** The method index of this method within its defining dex file */ protected int dexMethodIndex; + /** + * Hidden to workaround b/16828157. + * @hide + */ protected AbstractMethod() { } @@ -209,10 +217,7 @@ public abstract class AbstractMethod extends AccessibleObject { * * @return an array of arrays of {@code Annotation} instances */ - public Annotation[][] getParameterAnnotations() { - return AnnotationAccess.getParameterAnnotations( - declaringClassOfOverriddenMethod, dexMethodIndex); - } + public abstract Annotation[][] getParameterAnnotations(); /** * Returns the constructor's signature in non-printable form. This is called diff --git a/libart/src/main/java/java/lang/reflect/Constructor.java b/libart/src/main/java/java/lang/reflect/Constructor.java index 0e5706f..9701147 100644 --- a/libart/src/main/java/java/lang/reflect/Constructor.java +++ b/libart/src/main/java/java/lang/reflect/Constructor.java @@ -209,7 +209,8 @@ public final class Constructor extends AbstractMethod implements GenericDecla * @return an array of arrays of {@code Annotation} instances */ public Annotation[][] getParameterAnnotations() { - return super.getParameterAnnotations(); + return AnnotationAccess.getParameterAnnotations( + declaringClassOfOverriddenMethod, dexMethodIndex); } /** diff --git a/libart/src/main/java/java/lang/reflect/Method.java b/libart/src/main/java/java/lang/reflect/Method.java index 1439a3b..a07ec6f 100644 --- a/libart/src/main/java/java/lang/reflect/Method.java +++ b/libart/src/main/java/java/lang/reflect/Method.java @@ -309,7 +309,8 @@ public final class Method extends AbstractMethod implements GenericDeclaration, * @return an array of arrays of {@code Annotation} instances */ public Annotation[][] getParameterAnnotations() { - return super.getParameterAnnotations(); + return AnnotationAccess.getParameterAnnotations( + declaringClassOfOverriddenMethod, dexMethodIndex); } /** -- cgit v1.1