This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: more assertions for JNI


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);
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]