commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r378743 - in /jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl: GenericKeyedObjectPool.java GenericObjectPool.java
Date Sat, 18 Feb 2006 17:22:12 GMT
Author: rdonkin
Date: Sat Feb 18 09:22:07 2006
New Revision: 378743

URL: http://svn.apache.org/viewcvs?rev=378743&view=rev
Log:
Converted inner class to static and shared single instance. Contributed by Sandy McArthur.
Kudos due to FindBugs. Issue #38649.

Modified:
    jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
    jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java?rev=378743&r1=378742&r2=378743&view=diff
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
Sat Feb 18 09:22:07 2006
@@ -1310,14 +1310,15 @@
      * A simple "struct" encapsulating an object instance and a timestamp.
      *
      * Implements Comparable, objects are sorted from old to new.
+     *
+     * This is also used by {@link GenericObjectPool}.
      */
-    class ObjectTimestampPair implements Comparable {
+    static class ObjectTimestampPair implements Comparable {
         Object value;
         long tstamp;
 
         ObjectTimestampPair(Object val) {
-            value = val;
-            tstamp = System.currentTimeMillis();
+            this(val, System.currentTimeMillis());
         }
 
         ObjectTimestampPair(Object val, long time) {

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?rev=378743&r1=378742&r2=378743&view=diff
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Sat Feb 18 09:22:07 2006
@@ -26,6 +26,7 @@
 import org.apache.commons.pool.BaseObjectPool;
 import org.apache.commons.pool.ObjectPool;
 import org.apache.commons.pool.PoolableObjectFactory;
+import org.apache.commons.pool.impl.GenericKeyedObjectPool.ObjectTimestampPair;
 
 /**
  * A configurable {@link ObjectPool} implementation.
@@ -1100,23 +1101,6 @@
     }
 
     //--- inner classes ----------------------------------------------
-
-    /**
-     * A simple "struct" encapsulating an object instance and a timestamp.
-     */
-    class ObjectTimestampPair {
-        Object value;
-        long tstamp;
-
-        ObjectTimestampPair(Object val) {
-            this(val,System.currentTimeMillis());
-        }
-
-        ObjectTimestampPair(Object val, long time) {
-            value = val;
-            tstamp = time;
-        }
-    }
 
     /**
      * The idle object evictor {@link TimerTask}.



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message