summaryrefslogtreecommitdiffstats
path: root/libart
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2013-11-21 10:58:46 +0000
committerNarayan Kamath <narayan@google.com>2013-11-22 09:17:04 +0000
commit3b8c8cba4defe9049aca66d505e509395e5485f5 (patch)
treead367ee328b695bfc38f27f6bc05cc6e6fa077e6 /libart
parentb19562f2af4de36d2d5a89e667d7985f1b3e2d72 (diff)
downloadlibcore-3b8c8cba4defe9049aca66d505e509395e5485f5.zip
libcore-3b8c8cba4defe9049aca66d505e509395e5485f5.tar.gz
libcore-3b8c8cba4defe9049aca66d505e509395e5485f5.tar.bz2
Fix the art version of getGenericSuperclass.
art version of: https://android-review.googlesource.com/#/c/70325 bug: 10918616 Change-Id: Id4e221137410027757a5353476d78290f73d7ad8 (cherry picked from commit 34ab628b61321c17b5c1406656e7b352ab0a76a2)
Diffstat (limited to 'libart')
-rw-r--r--libart/src/main/java/java/lang/Class.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/libart/src/main/java/java/lang/Class.java b/libart/src/main/java/java/lang/Class.java
index eda2b5c..69e4e43 100644
--- a/libart/src/main/java/java/lang/Class.java
+++ b/libart/src/main/java/java/lang/Class.java
@@ -37,7 +37,6 @@ import dalvik.system.VMStack;
import java.io.InputStream;
import java.io.Serializable;
import java.lang.annotation.Annotation;
-import java.lang.reflect.AbstractMethod;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.ArtField;
@@ -1146,6 +1145,12 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe
*/
public Type getGenericSuperclass() {
Type genericSuperclass = getSuperclass();
+ // This method is specified to return null for all cases where getSuperclass
+ // returns null, i.e, for primitives, interfaces, void and java.lang.Object.
+ if (genericSuperclass == null) {
+ return null;
+ }
+
String annotationSignature = AnnotationAccess.getSignature(this);
if (annotationSignature != null) {
GenericSignatureParser parser = new GenericSignatureParser(getClassLoader());