summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-10-12 23:16:05 -0700
committerBrian Carlstrom <bdc@google.com>2013-10-12 23:16:33 -0700
commit4583b2cee94e9582a6c7a1d715f4896073d03bad (patch)
treef25e03ac983f970e7d2d4fc69825990a4b2db30c
parentc9b3e3cd287eff82f85a58934b192b5b174ae61c (diff)
downloadlibcore-4583b2cee94e9582a6c7a1d715f4896073d03bad.zip
libcore-4583b2cee94e9582a6c7a1d715f4896073d03bad.tar.gz
libcore-4583b2cee94e9582a6c7a1d715f4896073d03bad.tar.bz2
Fix Class.getDeclaringClass bug for ART
Bug: https://code.google.com/p/android/issues/detail?id=61003 Change-Id: Ia2cc774a9239ecd64f8039b2ca9e27593126e2cf
-rw-r--r--libart/src/main/java/java/lang/Class.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/libart/src/main/java/java/lang/Class.java b/libart/src/main/java/java/lang/Class.java
index d1b9a18..7dfe044 100644
--- a/libart/src/main/java/java/lang/Class.java
+++ b/libart/src/main/java/java/lang/Class.java
@@ -952,6 +952,9 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe
* method or constructor.
*/
public Class<?> getDeclaringClass() {
+ if (AnnotationAccess.isAnonymousClass(this)) {
+ return null;
+ }
return AnnotationAccess.getDeclaringClass(this);
}