Patch: more assertions for JNI
Tom Tromey
tromey@cygnus.com
Wed Feb 16 16:52:00 GMT 2000
I'm checking this in. It adds a couple more assertions to JNI.
There are a lot more we could add, and it might even be good to do so,
but I probably won't be doing it any time soon.
2000-02-16 Tom Tromey <tromey@cygnus.com>
* jni.cc (_Jv_JNI_CallStaticMethodV): Added some assertions.
Tom
Index: jni.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/jni.cc,v
retrieving revision 1.19
diff -u -r1.19 jni.cc
--- jni.cc 2000/02/16 22:42:41 1.19
+++ jni.cc 2000/02/17 00:51:20
@@ -756,6 +756,9 @@
_Jv_JNI_CallStaticMethodV (JNIEnv *env, jclass klass,
jmethodID id, va_list args)
{
+ JvAssert (((id->accflags) & java::lang::reflect::Modifier::STATIC));
+ JvAssert ((&ClassClass)->isInstance (klass));
+
return _Jv_JNI_CallAnyMethodV<T, static_type> (env, NULL, klass, id, args);
}
@@ -768,6 +771,9 @@
va_list args;
T result;
+ JvAssert (((id->accflags) & java::lang::reflect::Modifier::STATIC));
+ JvAssert ((&ClassClass)->isInstance (klass));
+
va_start (args, id);
result = _Jv_JNI_CallAnyMethodV<T, static_type> (env, NULL, klass,
id, args);
@@ -783,6 +789,9 @@
_Jv_JNI_CallStaticMethodA (JNIEnv *env, jclass klass, jmethodID id,
jvalue *args)
{
+ JvAssert (((id->accflags) & java::lang::reflect::Modifier::STATIC));
+ JvAssert ((&ClassClass)->isInstance (klass));
+
return _Jv_JNI_CallAnyMethodA<T, static_type> (env, NULL, klass, id, args);
}
More information about the Java-patches
mailing list