harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r441317 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref: PhantomReference.java Reference.java SoftReference.java WeakReference.java
Date Fri, 08 Sep 2006 01:23:04 GMT
Author: ndbeyer
Date: Thu Sep  7 18:23:03 2006
New Revision: 441317

URL: http://svn.apache.org/viewvc?view=rev&rev=441317
Log:
Code cleanup; add braces, compiler warnings, documentation, etc

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/PhantomReference.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/PhantomReference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/PhantomReference.java?view=diff&rev=441317&r1=441316&r2=441317
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/PhantomReference.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/PhantomReference.java
Thu Sep  7 18:23:03 2006
@@ -19,30 +19,30 @@
  * PhantomReference objects are used to detect referents which are no longer
  * visible and are eligible to have their storage reclaimed.
  * 
- * @since JDK1.2
+ * @since 1.2
  */
 public class PhantomReference<T> extends Reference<T> {
 
     /**
-     * Return the referent of the reference object. Phantom reference objects
-     * referents are inaccessible, and so null is returned.
+     * Constructs a new instance of this class.
      * 
-     * @return Object Returns null.
+     * 
+     * @param r referent to track.
+     * @param q queue to register to the reference object with.
      */
-    public T get() {
-        return null;
+    public PhantomReference(T r, ReferenceQueue<? super T> q) {
+        super();
+        initReference(r, q);
     }
 
     /**
-     * Constructs a new instance of this class.
-     * 
+     * Return the referent of the reference object. Phantom reference objects
+     * referents are inaccessible, and so null is returned.
      * 
-     * @param r
-     *            referent to track.
-     * @param q
-     *            queue to register to the reference object with.
+     * @return Object Returns null.
      */
-    public PhantomReference(T r, ReferenceQueue<? super T> q) {
-        super();
+    @Override
+    public T get() {
+        return super.get();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java?view=diff&rev=441317&r1=441316&r2=441317
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/Reference.java
Thu Sep  7 18:23:03 2006
@@ -23,9 +23,17 @@
  * constructors, the vm vendor may elect to implement the subclasses as well.
  * Abstract class which describes behavior common to all reference objects.
  * 
- * @since JDK1.2
+ * @since 1.2
  */
-public abstract class Reference<T> extends Object {
+public abstract class Reference<T> {
+
+    /**
+     * Constructs a new instance of this class.
+     * 
+     */
+    Reference() {
+        super();
+    }
 
     /**
      * Make the referent null. This does not force the reference object to be
@@ -65,30 +73,11 @@
     }
 
     /**
-     * Enqueue the reference object on the associated queue.
-     * 
-     * @return boolean true if the Reference was successfully enqueued. false
-     *         otherwise.
-     */
-    boolean enqueueImpl() {
-        return false;
-    }
-
-    /**
-     * Constructs a new instance of this class.
-     * 
-     */
-    Reference() {
-        super();
-    }
-
-    /**
      * Implement this method to support the provided subclass implementations.
      * Initialize a newly created reference object. Associate the reference
      * object with the referent.
      * 
-     * @param r
-     *            the referent
+     * @param r the referent
      */
     void initReference(Object r) {
         return;
@@ -99,13 +88,21 @@
      * Initialize a newly created reference object. Associate the reference
      * object with the referent, and the specified ReferenceQueue.
      * 
-     * @param r
-     *            the referent
-     * @param q
-     *            the ReferenceQueue
+     * @param r the referent
+     * @param q the ReferenceQueue
      */
-    void initReference(Object r, ReferenceQueue q) {
+    void initReference(Object r, ReferenceQueue<? super T> q) {
         return;
+    }
+
+    /**
+     * Enqueue the reference object on the associated queue.
+     * 
+     * @return boolean true if the Reference was successfully enqueued. false
+     *         otherwise.
+     */
+    boolean enqueueImpl() {
+        return false;
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java?view=diff&rev=441317&r1=441316&r2=441317
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/SoftReference.java
Thu Sep  7 18:23:03 2006
@@ -19,30 +19,29 @@
  * SoftReference objects are used to detect referents which are no longer
  * visible and who's memory is to be reclaimed.
  * 
- * @since JDK1.2
+ * @since 1.2
  */
 public class SoftReference<T> extends Reference<T> {
 
     /**
      * Constructs a new instance of this class.
      * 
-     * @param r
-     *            referent to track.
-     * @param q
-     *            queue to register to the reference object with.
+     * @param r referent to track.
      */
-    public SoftReference(T r, ReferenceQueue<? super T> q) {
-        initReference(r, q);
+    public SoftReference(T r) {
+        super();
+        initReference(r);
     }
-
+    
     /**
      * Constructs a new instance of this class.
      * 
-     * @param r
-     *            referent to track.
+     * @param r referent to track.
+     * @param q queue to register to the reference object with.
      */
-    public SoftReference(T r) {
-        initReference(r);
+    public SoftReference(T r, ReferenceQueue<? super T> q) {
+        super();
+        initReference(r, q);
     }
 
     /**
@@ -51,6 +50,7 @@
      * @return Object Referent to which reference refers, or null if object has
      *         been cleared.
      */
+    @Override
     public T get() {
         return super.get();
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java?view=diff&rev=441317&r1=441316&r2=441317
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ref/WeakReference.java
Thu Sep  7 18:23:03 2006
@@ -19,29 +19,28 @@
  * WeakReference objects are used to detect referents which are no longer
  * visible.
  * 
- * @since JDK1.2
+ * @since 1.2
  */
 public class WeakReference<T> extends Reference<T> {
 
     /**
      * Constructs a new instance of this class.
      * 
-     * @param r
-     *            referent to track.
-     * @param q
-     *            queue to register to the reference object with.
+     * @param r referent to track.
      */
-    public WeakReference(T r, ReferenceQueue<? super T> q) {
-        initReference(r, q);
+    public WeakReference(T r) {
+        super();
+        initReference(r);
     }
 
     /**
      * Constructs a new instance of this class.
      * 
-     * @param r
-     *            referent to track.
+     * @param r referent to track.
+     * @param q queue to register to the reference object with.
      */
-    public WeakReference(T r) {
-        initReference(r);
+    public WeakReference(T r, ReferenceQueue<? super T> q) {
+        super();
+        initReference(r, q);
     }
 }



Mime
View raw message