Revert "reflection: Add new 1.8 AnnotatedElement methods and tests"
Breaks interpreter access checks:
+Exception in thread "main" java.lang.InternalError: java.lang.IllegalAccessError: Method 'void java.lang.reflect.Proxy.doNewInstanceCheck()' is inaccessible to class '$Proxy0' (declaration of '$Proxy0' appears in generated class)
This reverts commit c167ee9b65f05f7c6f007d587fd1655388edaee9.
Change-Id: I6c9429cb6f298e89a2da22f7ded0728251321446
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index a80585a..0ddd4a2 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -469,21 +469,14 @@
return soa.AddLocalReference<jobjectArray>(ret.Get());
}
-static jobject Class_getDeclaredAnnotation(JNIEnv* env, jobject javaThis, jclass annotationClass) {
+static jobject Class_getDeclaredAnnotation(JNIEnv* env, jobject javaThis, jclass annotationType) {
ScopedFastNativeObjectAccess soa(env);
StackHandleScope<2> hs(soa.Self());
Handle<mirror::Class> klass(hs.NewHandle(DecodeClass(soa, javaThis)));
-
- // Handle public contract to throw NPE if the "annotationClass" argument was null.
- if (UNLIKELY(annotationClass == nullptr)) {
- ThrowNullPointerException("annotationClass");
- return nullptr;
- }
-
if (klass->IsProxyClass() || klass->GetDexCache() == nullptr) {
return nullptr;
}
- Handle<mirror::Class> annotation_class(hs.NewHandle(soa.Decode<mirror::Class*>(annotationClass)));
+ Handle<mirror::Class> annotation_class(hs.NewHandle(soa.Decode<mirror::Class*>(annotationType)));
return soa.AddLocalReference<jobject>(
klass->GetDexFile().GetAnnotationForClass(klass, annotation_class));
}