diff options
Diffstat (limited to 'test/910-methods/methods.cc')
| -rw-r--r-- | test/910-methods/methods.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/910-methods/methods.cc b/test/910-methods/methods.cc index 214ae505d6..cc6ad6793b 100644 --- a/test/910-methods/methods.cc +++ b/test/910-methods/methods.cc @@ -91,6 +91,22 @@ extern "C" JNIEXPORT jclass JNICALL Java_Main_getMethodDeclaringClass( return declaring_class; } +extern "C" JNIEXPORT jint JNICALL Java_Main_getMethodModifiers( + JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) { + jmethodID id = env->FromReflectedMethod(method); + + jint modifiers; + jvmtiError result = jvmti_env->GetMethodModifiers(id, &modifiers); + if (result != JVMTI_ERROR_NONE) { + char* err; + jvmti_env->GetErrorName(result, &err); + printf("Failure running GetMethodModifiers: %s\n", err); + return 0; + } + + return modifiers; +} + // Don't do anything jint OnLoad(JavaVM* vm, char* options ATTRIBUTE_UNUSED, |