+2002-11-19 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/ref/natReference.cc (add_to_hash): Look at `copy', not
+ `referent'.
+ (finalize_referred_to_object): Don't modify `referent' or `copy'
+ fields.
+ (add_to_hash): Correctly set `n->next' when updating list.
+ * java/lang/ref/Reference.java (enqueue): Return false if already
+ enqueued.
+
2002-11-19 Ranjit Mathew <rmathew@hotmail.com>
* include/jni.h: Add missing JNICALL and JNIEXPORT attributes
/* java.lang.ref.Reference
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
*/
public boolean enqueue()
{
- if (queue != null)
+ if (queue != null && nextOnQueue == null)
{
queue.enqueue(this);
queue = null;
// natReference.cc - Native code for References
-/* Copyright (C) 2001 Free Software Foundation
+/* Copyright (C) 2001, 2002 Free Software Foundation
This file is part of libgcj.
if (3 * hash_count >= 2 * hash_size)
rehash ();
- jobject referent = the_reference->referent;
+ // Use `copy' here because the `referent' field has been cleared.
+ jobject referent = the_reference->copy;
object_list *item = find_slot (referent);
if (item->reference == NULL)
{
link = &iter->next;
iter = *link;
}
- n->next = (*link) ? (*link)->next : NULL;
+ n->next = *link;
*link = n;
}
// If the copy is already NULL then the user must have
// called Reference.clear().
if (ref->copy != NULL)
- {
- if (w == PHANTOM)
- ref->referent = ref->copy;
- else
- ref->copy = NULL;
- ref->enqueue ();
- }
+ ref->enqueue ();
object_list *next = head->next;
_Jv_Free (head);