Signed-off-by: Vegard Nossum <vegard.nos...@gmail.com> --- vm/jni-interface.c | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/vm/jni-interface.c b/vm/jni-interface.c index c955dfb..2b6dc28 100644 --- a/vm/jni-interface.c +++ b/vm/jni-interface.c @@ -85,6 +85,7 @@ static jmethodID vm_jni_get_method_id(struct vm_jni_env *env, jclass clazz, if (exception_occurred()) return NULL; + /* XXX: Make sure it's not static. */ mb = vm_class_get_method(class, name, sig); if (!mb) { signal_new_exception(vm_java_lang_NoSuchMethodError, NULL); @@ -110,6 +111,7 @@ static jfieldID vm_jni_get_field_id(struct vm_jni_env *env, jclass clazz, if (exception_occurred()) return NULL; + /* XXX: Make sure it's not static. */ fb = vm_class_get_field(class, name, sig); if (!fb) { signal_new_exception(vm_java_lang_NoSuchFieldError, NULL); @@ -119,6 +121,31 @@ static jfieldID vm_jni_get_field_id(struct vm_jni_env *env, jclass clazz, return fb; } +static jmethodID vm_jni_get_static_method_id(struct vm_jni_env *env, + jclass clazz, const char *name, const char *sig) +{ + struct vm_method *mb; + struct vm_class *class; + + check_null(clazz); + + class = vm_class_get_class_from_class_object(clazz); + check_null(class); + + vm_class_ensure_init(class); + if (exception_occurred()) + return NULL; + + /* XXX: Make sure it's actually static. */ + mb = vm_class_get_method(class, name, sig); + if (!mb) { + signal_new_exception(vm_java_lang_NoSuchMethodError, NULL); + return NULL; + } + + return mb; +} + static const jbyte* vm_jni_get_string_utf_chars(struct vm_jni_env *env, jobject string, jboolean *is_copy) { @@ -352,7 +379,7 @@ void *vm_jni_native_interface[] = { NULL, /* SetLongField */ NULL, /* SetFloatField */ NULL, /* SetDoubleField */ - NULL, /* GetStaticMethodID */ + vm_jni_get_static_method_id, NULL, /* CallStaticObjectMethod */ /* 115 */ -- 1.6.0.4 ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/blackberry _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel