Patch: jni weak reference fix
Anthony Green
green@redhat.com
Sun Oct 7 16:49:00 GMT 2001
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 ());
More information about the Java-patches
mailing list