This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: more assertions for JNI
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: more assertions for JNI
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 16 Feb 2000 17:54:45 -0700
- Reply-To: tromey at cygnus dot com
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);
}