jni fixlet

Tom Tromey tromey@redhat.com
Wed Feb 7 22:44:00 GMT 2007


>>>>> "Marco" == Marco Trudel <mtrudel@gmx.ch> writes:

Marco> Attached the version with the comment on the second line.

A few formatting nits... it is a little more usual not to put comments
on the same line as code (except for something like a table).  Also
there is a space between 'if' and '('.  Finally ChangeLog entries have
a precise formatting, including a tab before the '*'.

It is a little silly that a 3 line patch can result in so much
conversation.  But, that's GCC for you :-}

Here's what I'm checking in.

Do you know whether we need this for local refs as well?

Tom

Index: ChangeLog
from  Marco Trudel <mtrudel@gmx.ch>

	* jni.cc (_Jv_JNI_DeleteWeakGlobalRef): Check for NULL objects.

Index: jni.cc
===================================================================
--- jni.cc	(revision 121691)
+++ jni.cc	(working copy)
@@ -1750,6 +1750,10 @@
 void JNICALL
 _Jv_JNI_DeleteWeakGlobalRef (JNIEnv *, jweak obj)
 {
+  // JDK compatibility.
+  if (obj == NULL)
+    return;
+
   using namespace gnu::gcj::runtime;
   JNIWeakRef *ref = reinterpret_cast<JNIWeakRef *> (obj);
   unmark_for_gc (ref, global_ref_table);



More information about the Java-patches mailing list