From 97b8365cafc3a344a22d3980b8ed885f5c6d8357 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 9 Jan 2007 19:58:05 +0000 Subject: Merged gcj-eclipse branch to trunk. From-SVN: r120621 --- libjava/java/lang/ref/Reference.java | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'libjava/java/lang/ref/Reference.java') diff --git a/libjava/java/lang/ref/Reference.java b/libjava/java/lang/ref/Reference.java index ab0c55c..a5184ce 100644 --- a/libjava/java/lang/ref/Reference.java +++ b/libjava/java/lang/ref/Reference.java @@ -1,5 +1,5 @@ /* java.lang.ref.Reference - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -70,7 +70,7 @@ package java.lang.ref; * @author Jochen Hoenicke * @see java.util.WeakHashtable */ -public abstract class Reference +public abstract class Reference { /** * The underlying object. This field is handled in a special way by @@ -105,7 +105,7 @@ public abstract class Reference * The queue this reference is registered on. This is null, if this * wasn't registered to any queue or reference was already enqueued. */ - ReferenceQueue queue; + ReferenceQueue queue; /** * Link to the next entry on the queue. If this is null, this @@ -129,7 +129,7 @@ public abstract class Reference * class in a different package. * @param referent the object we refer to. */ - Reference(Object ref) + Reference(T ref) { create (ref); } @@ -142,7 +142,7 @@ public abstract class Reference * @param q the reference queue to register on. * @exception NullPointerException if q is null. */ - Reference(Object ref, ReferenceQueue q) + Reference(T ref, ReferenceQueue q) { if (q == null) throw new NullPointerException(); @@ -153,20 +153,14 @@ public abstract class Reference /** * Notifies the VM that a new Reference has been created. */ - private native void create (Object o); + private native void create (T o); /** * Returns the object, this reference refers to. * @return the object, this reference refers to, or null if the * reference was cleared. */ - public Object get() - { - synchronized (lock) - { - return referent; - } - } + public native T get(); /** * Clears the reference, so that it doesn't refer to its object -- cgit v1.1