jni fixlet

Marco Trudel mtrudel@gmx.ch
Thu Feb 8 00:01:00 GMT 2007


Tom Tromey wrote:
>>>>>> "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 '*'.

So less code and so much formatting issues... Sorry about that. I never 
got around to read the GCC coding conventions. Where do I find them?


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

Actually the common agreement was that I run a "make check" with it and 
create a regression test. Well, then I'll do that for the next patch (at 
least as long as they're not win32 only).


> Here's what I'm checking in.

Thank you for your time!


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

Yes and No. It also has to ignore NULL pointers, but this is done 
already. Coincidence maybe ;-)
I wrote a little testcase for both. Maybe you want to check them in as 
regression tests...


thanks again
Marco


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

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: DeleteRefTest.c
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070208/f3fb2208/attachment.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: DeleteRefTest.java
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070208/f3fb2208/attachment.ksh>


More information about the Java-patches mailing list