This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: jni weak reference fix
- From: Anthony Green <green at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Sat, 17 Nov 2001 13:31:27 -0800
- Subject: Patch: jni weak reference fix
- Reply-to: green at cygnus dot com
I'm checking in this obvious fix..
2001-11-17 Anthony Green <green@redhat.com>
* jni.cc (unwrap): Fix test for wrapped objects.
Index: jni.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni.cc,v
retrieving revision 1.55
diff -c -r1.55 jni.cc
*** jni.cc 2001/11/13 17:43:39 1.55
--- jni.cc 2001/11/17 21:28:37
***************
*** 212,218 ****
using namespace gnu::gcj::runtime;
// We can compare the class directly because JNIWeakRef is `final'.
// Doing it this way is much faster.
! if (obj == NULL || obj->getClass () == &JNIWeakRef::class$)
return obj;
JNIWeakRef *wr = reinterpret_cast<JNIWeakRef *> (obj);
return reinterpret_cast<T *> (wr->get ());
--- 212,218 ----
using namespace gnu::gcj::runtime;
// We can compare the class directly because JNIWeakRef is `final'.
// Doing it this way is much faster.
! if (obj == NULL || obj->getClass () != &JNIWeakRef::class$)
return obj;
JNIWeakRef *wr = reinterpret_cast<JNIWeakRef *> (obj);
return reinterpret_cast<T *> (wr->get ());