From 4583b2cee94e9582a6c7a1d715f4896073d03bad Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Sat, 12 Oct 2013 23:16:05 -0700 Subject: Fix Class.getDeclaringClass bug for ART Bug: https://code.google.com/p/android/issues/detail?id=61003 Change-Id: Ia2cc774a9239ecd64f8039b2ca9e27593126e2cf --- libart/src/main/java/java/lang/Class.java | 3 +++ 1 file changed, 3 insertions(+) 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 implements Serializable, AnnotatedElement, GenericDe * method or constructor. */ public Class getDeclaringClass() { + if (AnnotationAccess.isAnonymousClass(this)) { + return null; + } return AnnotationAccess.getDeclaringClass(this); } -- cgit v1.1