classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnu_java_awt_peer_gtk_GdkFontPeer.c (initStaticState): missing NewGl


From: Christian Thalinger
Subject: Re: gnu_java_awt_peer_gtk_GdkFontPeer.c (initStaticState): missing NewGlobalRef?
Date: Thu, 10 Nov 2005 20:38:27 +0100

On Tue, 2005-11-08 at 16:42 +0100, Christian Thalinger wrote:
> We are currently developing a JNI source code analyzer, which scans for
> missing NewGlobalRef calls (this is for popl06).  And it seems that it
> has found a bug in GNU classpath's gtk peers.

Ok, here are the 2 missing jclass bugs we've found:

Index: native/jni/java-lang/java_lang_VMDouble.c
===================================================================
RCS file: 
/cvsroot/classpath/classpath/native/jni/java-lang/java_lang_VMDouble.c,v
retrieving revision 1.11
diff -u -3 -p -r1.11 java_lang_VMDouble.c
--- native/jni/java-lang/java_lang_VMDouble.c   24 Aug 2005 14:18:52 -0000      
1.11
+++ native/jni/java-lang/java_lang_VMDouble.c   10 Nov 2005 19:34:14 -0000
@@ -71,6 +71,11 @@ Java_java_lang_VMDouble_initIDs (JNIEnv 
     {
       DBG ("unable to get class java.lang.Double\n") return;
     }
+  clsDouble = (*env)->NewGlobalRef(env, clsDouble);
+  if (clsDouble == NULL)
+    {
+      DBG ("unable to register class java.lang.Double as global ref\n") return;
+    }
   isNaNID = (*env)->GetStaticMethodID (env, clsDouble, "isNaN", "(D)Z");
   if (isNaNID == NULL)
     {
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
===================================================================
RCS file: 
/cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c,v
retrieving revision 1.24
diff -u -3 -p -r1.24 gnu_java_awt_peer_gtk_GtkToolkit.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c      24 Sep 2005 
21:01:07 -0000      1.24
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c      10 Nov 2005 
19:34:14 -0000
@@ -135,6 +135,8 @@ Java_gnu_java_awt_peer_gtk_GtkToolkit_gt
 
   gtkgenericpeer = (*env)->FindClass(env, 
"gnu/java/awt/peer/gtk/GtkGenericPeer");
 
+  gtkgenericpeer = (*env)->NewGlobalRef(env, gtkgenericpeer);
+
   printCurrentThreadID = (*env)->GetStaticMethodID (env, gtkgenericpeer,
                                                     "printCurrentThread", 
"()V");
  

There are a lot more warnings and potential bugs concerning jmethod,
jfieldID, etc.  Should i post a list of the warnings i think they may be
a bug (some of them are marked as "strange")?

TWISTI





reply via email to

[Prev in Thread] Current Thread [Next in Thread]