12a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes/*
22a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * Copyright (C) 2008 The Android Open Source Project
32a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes *
42a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * Licensed under the Apache License, Version 2.0 (the "License");
52a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * you may not use this file except in compliance with the License.
62a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * You may obtain a copy of the License at
72a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes *
82a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes *      http://www.apache.org/licenses/LICENSE-2.0
92a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes *
102a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * Unless required by applicable law or agreed to in writing, software
112a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * distributed under the License is distributed on an "AS IS" BASIS,
122a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * See the License for the specific language governing permissions and
142a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes * limitations under the License.
152a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes */
162a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes
17277ccbd200ea43590dfc06a93ae184a765327ad0Andreas Gampe#include "java_lang_reflect_Constructor.h"
18277ccbd200ea43590dfc06a93ae184a765327ad0Andreas Gampe
19e401d146407d61eeb99f8d6176b2ac13c4df1e33Mathieu Chartier#include "art_method-inl.h"
202a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes#include "class_linker.h"
2113e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao#include "class_linker-inl.h"
22eac766769e3114a078c188ea26776a81f0edb3cfElliott Hughes#include "jni_internal.h"
232dd0e2cea360bc9206eb88ecc40d259e796c239dIan Rogers#include "mirror/class-inl.h"
24fc58af45e342ba9e18bbdf597f205a58ec731658Mathieu Chartier#include "mirror/method.h"
252dd0e2cea360bc9206eb88ecc40d259e796c239dIan Rogers#include "mirror/object-inl.h"
262a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes#include "reflection.h"
2753b8b09fc80329539585dcf43657bc5f4ecefdffIan Rogers#include "scoped_fast_native_object_access.h"
28ea46f950e7a51585db293cd7f047de190a482414Brian Carlstrom#include "well_known_classes.h"
292a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes
302a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughesnamespace art {
312a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes
3213e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Haostatic jobject Constructor_getAnnotationNative(JNIEnv* env, jobject javaMethod,
3313e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao                                               jclass annotationType) {
3413e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ScopedFastNativeObjectAccess soa(env);
3513e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  StackHandleScope<1> hs(soa.Self());
3613e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ArtMethod* method = ArtMethod::FromReflectedMethod(soa, javaMethod);
373e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  if (method->IsProxyMethod()) {
383e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    return nullptr;
393e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  } else {
403e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    Handle<mirror::Class> klass(hs.NewHandle(soa.Decode<mirror::Class*>(annotationType)));
413e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    return soa.AddLocalReference<jobject>(
423e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light        method->GetDexFile()->GetAnnotationForMethod(method, klass));
433e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  }
4413e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao}
4513e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao
4613e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Haostatic jobjectArray Constructor_getDeclaredAnnotations(JNIEnv* env, jobject javaMethod) {
4713e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ScopedFastNativeObjectAccess soa(env);
4813e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ArtMethod* method = ArtMethod::FromReflectedMethod(soa, javaMethod);
493e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  if (method->IsProxyMethod()) {
503e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    mirror::Class* class_class = mirror::Class::GetJavaLangClass();
513e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    mirror::Class* class_array_class =
523e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light        Runtime::Current()->GetClassLinker()->FindArrayClass(soa.Self(), &class_class);
533e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    if (class_array_class == nullptr) {
543e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light      return nullptr;
553e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    }
563e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    mirror::ObjectArray<mirror::Class>* empty_array =
573e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light        mirror::ObjectArray<mirror::Class>::Alloc(soa.Self(), class_array_class, 0);
583e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    return soa.AddLocalReference<jobjectArray>(empty_array);
593e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  } else {
603e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    return soa.AddLocalReference<jobjectArray>(
613e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light        method->GetDexFile()->GetAnnotationsForMethod(method));
623e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  }
6313e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao}
6413e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao
6513e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Haostatic jobjectArray Constructor_getExceptionTypes(JNIEnv* env, jobject javaMethod) {
6613e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ScopedFastNativeObjectAccess soa(env);
672f7c9d9613978dc6b135b42b0e5e57f22b82cc9bAlex Light  ArtMethod* method = ArtMethod::FromReflectedMethod(soa, javaMethod)
682f7c9d9613978dc6b135b42b0e5e57f22b82cc9bAlex Light      ->GetInterfaceMethodIfProxy(sizeof(void*));
692a5892f9ebcd4b7bd7343db50e578bd24b8e55a6Jeff Hao  mirror::ObjectArray<mirror::Class>* result_array =
7013e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao      method->GetDexFile()->GetExceptionTypesForMethod(method);
7113e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  if (result_array == nullptr) {
7213e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao    // Return an empty array instead of a null pointer.
7313e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao    mirror::Class* class_class = mirror::Class::GetJavaLangClass();
7413e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao    mirror::Class* class_array_class =
7513e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao        Runtime::Current()->GetClassLinker()->FindArrayClass(soa.Self(), &class_class);
762a5892f9ebcd4b7bd7343db50e578bd24b8e55a6Jeff Hao    if (class_array_class == nullptr) {
772a5892f9ebcd4b7bd7343db50e578bd24b8e55a6Jeff Hao      return nullptr;
782a5892f9ebcd4b7bd7343db50e578bd24b8e55a6Jeff Hao    }
792a5892f9ebcd4b7bd7343db50e578bd24b8e55a6Jeff Hao    mirror::ObjectArray<mirror::Class>* empty_array =
802a5892f9ebcd4b7bd7343db50e578bd24b8e55a6Jeff Hao        mirror::ObjectArray<mirror::Class>::Alloc(soa.Self(), class_array_class, 0);
8113e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao    return soa.AddLocalReference<jobjectArray>(empty_array);
8213e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  } else {
8313e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao    return soa.AddLocalReference<jobjectArray>(result_array);
8413e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  }
8513e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao}
8613e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao
8713e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Haostatic jobjectArray Constructor_getParameterAnnotationsNative(JNIEnv* env, jobject javaMethod) {
8813e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ScopedFastNativeObjectAccess soa(env);
8913e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ArtMethod* method = ArtMethod::FromReflectedMethod(soa, javaMethod);
903e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  if (method->IsProxyMethod()) {
913e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    return nullptr;
923e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  } else {
933e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    return soa.AddLocalReference<jobjectArray>(
943e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light        method->GetDexFile()->GetParameterAnnotations(method));
953e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  }
9613e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao}
9713e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao
9813e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Haostatic jboolean Constructor_isAnnotationPresentNative(JNIEnv* env, jobject javaMethod,
9913e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao                                                      jclass annotationType) {
10013e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ScopedFastNativeObjectAccess soa(env);
10113e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  StackHandleScope<1> hs(soa.Self());
10213e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  ArtMethod* method = ArtMethod::FromReflectedMethod(soa, javaMethod);
1033e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  if (method->IsProxyMethod()) {
1043e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    // Proxies have no annotations.
1053e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light    return false;
1063e0eff468ba3bf68229fc58101c73f45d43b7c8fAlex Light  }
10713e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  Handle<mirror::Class> klass(hs.NewHandle(soa.Decode<mirror::Class*>(annotationType)));
10813e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  return method->GetDexFile()->IsMethodAnnotationPresent(method, klass);
10913e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao}
11013e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao
111f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier/*
1128208bddbefa9613422b9c6a19ce39a24391beec3Andreas Gampe * We can also safely assume the constructor isn't associated
113f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier * with an interface, array, or primitive class. If this is coming from
114f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier * native, it is OK to avoid access checks since JNI does not enforce them.
115f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier */
116dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniakstatic jobject Constructor_newInstance0(JNIEnv* env, jobject javaMethod, jobjectArray javaArgs) {
11753b8b09fc80329539585dcf43657bc5f4ecefdffIan Rogers  ScopedFastNativeObjectAccess soa(env);
1182d2f2a9c665b02ca5139f71e37ca5e08389e4191Sebastien Hertz  mirror::Constructor* m = soa.Decode<mirror::Constructor*>(javaMethod);
119eb8167a4f4d27fce0530f6724ab8032610cd146bMathieu Chartier  StackHandleScope<1> hs(soa.Self());
120eb8167a4f4d27fce0530f6724ab8032610cd146bMathieu Chartier  Handle<mirror::Class> c(hs.NewHandle(m->GetDeclaringClass()));
12162d6c772205b8859f0ebf7ad105402ec4c3e2e01Ian Rogers  if (UNLIKELY(c->IsAbstract())) {
122f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier    soa.Self()->ThrowNewExceptionF("Ljava/lang/InstantiationException;", "Can't instantiate %s %s",
12362d6c772205b8859f0ebf7ad105402ec4c3e2e01Ian Rogers                                   c->IsInterface() ? "interface" : "abstract class",
124eb8167a4f4d27fce0530f6724ab8032610cd146bMathieu Chartier                                   PrettyDescriptor(c.Get()).c_str());
125c528dba35b5faece51ca658fc008b688f8b690adMathieu Chartier    return nullptr;
1262a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes  }
1278208bddbefa9613422b9c6a19ce39a24391beec3Andreas Gampe  // Verify that we can access the class.
1282d2f2a9c665b02ca5139f71e37ca5e08389e4191Sebastien Hertz  if (!m->IsAccessible() && !c->IsPublic()) {
1293ddd593cbeac6fc0e310e604d56fb732476b1699Przemyslaw Szczepaniak    // Go 2 frames back, this method is always called from newInstance0, which is called from
130e0915821252b68e363d0ecfff07606e9d274f5faNarayan Kamath    // Constructor.newInstance(Object... args).
1313ddd593cbeac6fc0e310e604d56fb732476b1699Przemyslaw Szczepaniak    auto* caller = GetCallingClass(soa.Self(), 2);
132f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier    // If caller is null, then we called from JNI, just avoid the check since JNI avoids most
133f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier    // access checks anyways. TODO: Investigate if this the correct behavior.
134f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier    if (caller != nullptr && !caller->CanAccess(c.Get())) {
13561d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe      if (PrettyDescriptor(c.Get()) == "dalvik.system.DexPathList$Element") {
13661d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe        // b/20699073.
13761d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe        LOG(WARNING) << "The dalvik.system.DexPathList$Element constructor is not accessible by "
13861d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe                        "default. This is a temporary workaround for backwards compatibility "
13961d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe                        "with class-loader hacks. Please update your application.";
14061d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe      } else {
14161d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe        soa.Self()->ThrowNewExceptionF(
14261d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe            "Ljava/lang/IllegalAccessException;", "%s is not accessible from %s",
14361d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe            PrettyClass(c.Get()).c_str(), PrettyClass(caller).c_str());
14461d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe        return nullptr;
14561d7ca870b7afc5400e6f7dd2952ca06ce7f7bacAndreas Gampe      }
146f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier    }
147f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier  }
1487b078e8c04f3e1451dbdd18543c8b9692b5b067eIan Rogers  if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(soa.Self(), c, true, true)) {
14900f7d0eaa6bd93d33bf0c1429bf4ba0b3f28abacIan Rogers    DCHECK(soa.Self()->IsExceptionPending());
150c528dba35b5faece51ca658fc008b688f8b690adMathieu Chartier    return nullptr;
1515d40f182181488eb39ccd19ffd306bb1fb9740c9Brian Carlstrom  }
152f4b97628bc78b928934b8b0876ccad2f2f8960a3Mathieu Chartier  bool movable = true;
153f36cb5f65cb150151aa40b23937e2b0ad75cc546Mathieu Chartier  if (!kMovingClasses && c->IsClassClass()) {
154f4b97628bc78b928934b8b0876ccad2f2f8960a3Mathieu Chartier    movable = false;
155f4b97628bc78b928934b8b0876ccad2f2f8960a3Mathieu Chartier  }
156848f70a3d73833fc1bf3032a9ff6812e429661d9Jeff Hao
157848f70a3d73833fc1bf3032a9ff6812e429661d9Jeff Hao  // String constructor is replaced by a StringFactory method in InvokeMethod.
158848f70a3d73833fc1bf3032a9ff6812e429661d9Jeff Hao  if (c->IsStringClass()) {
159e0915821252b68e363d0ecfff07606e9d274f5faNarayan Kamath    return InvokeMethod(soa, javaMethod, nullptr, javaArgs, 2);
160848f70a3d73833fc1bf3032a9ff6812e429661d9Jeff Hao  }
161848f70a3d73833fc1bf3032a9ff6812e429661d9Jeff Hao
162f4b97628bc78b928934b8b0876ccad2f2f8960a3Mathieu Chartier  mirror::Object* receiver =
163f4b97628bc78b928934b8b0876ccad2f2f8960a3Mathieu Chartier      movable ? c->AllocObject(soa.Self()) : c->AllocNonMovableObject(soa.Self());
164c528dba35b5faece51ca658fc008b688f8b690adMathieu Chartier  if (receiver == nullptr) {
165c528dba35b5faece51ca658fc008b688f8b690adMathieu Chartier    return nullptr;
1662a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes  }
16700f7d0eaa6bd93d33bf0c1429bf4ba0b3f28abacIan Rogers  jobject javaReceiver = soa.AddLocalReference<jobject>(receiver);
168e0915821252b68e363d0ecfff07606e9d274f5faNarayan Kamath  InvokeMethod(soa, javaMethod, javaReceiver, javaArgs, 2);
1692a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes  // Constructors are ()V methods, so we shouldn't touch the result of InvokeMethod.
1702a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes  return javaReceiver;
1712a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes}
1722a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes
173dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniakstatic jobject Constructor_newInstanceFromSerialization(JNIEnv* env, jclass unused ATTRIBUTE_UNUSED,
174dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniak                                                        jclass ctorClass, jclass allocClass) {
175dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniak    jmethodID ctor = env->GetMethodID(ctorClass, "<init>", "()V");
176dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniak    DCHECK(ctor != NULL);
177dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniak    return env->NewObject(allocClass, ctor);
178dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniak}
179dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniak
1802a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughesstatic JNINativeMethod gMethods[] = {
18113e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  NATIVE_METHOD(Constructor, getAnnotationNative,
18213e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao                "!(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;"),
18313e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  NATIVE_METHOD(Constructor, getDeclaredAnnotations, "!()[Ljava/lang/annotation/Annotation;"),
18413e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  NATIVE_METHOD(Constructor, getExceptionTypes, "!()[Ljava/lang/Class;"),
18513e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  NATIVE_METHOD(Constructor, getParameterAnnotationsNative,
18613e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao                "!()[[Ljava/lang/annotation/Annotation;"),
18713e748b28c5f2bd1e83674d2ca899ff61ae5c0a1Jeff Hao  NATIVE_METHOD(Constructor, isAnnotationPresentNative, "!(Ljava/lang/Class;)Z"),
188dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniak  NATIVE_METHOD(Constructor, newInstance0, "!([Ljava/lang/Object;)Ljava/lang/Object;"),
189dcf1b59d6f834cce110028e20a00187091c0138aPrzemyslaw Szczepaniak  NATIVE_METHOD(Constructor, newInstanceFromSerialization, "!(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/Object;"),
1902a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes};
1912a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes
1922a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughesvoid register_java_lang_reflect_Constructor(JNIEnv* env) {
193eac766769e3114a078c188ea26776a81f0edb3cfElliott Hughes  REGISTER_NATIVE_METHODS("java/lang/reflect/Constructor");
1942a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes}
1952a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes
1962a20cfd0b7fc81099f5de0da782ebcc1cb262792Elliott Hughes}  // namespace art
197