commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1101912 - in /commons/proper/pool/trunk/src: java/org/apache/commons/pool2/impl/ test/org/apache/commons/pool2/impl/
Date Wed, 11 May 2011 14:59:53 GMT
Author: markt
Date: Wed May 11 14:59:52 2011
New Revision: 1101912

URL: http://svn.apache.org/viewvc?rev=1101912&view=rev
Log:
More clean-up

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/CursorableLinkedList.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackObjectPoolFactory.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/CursorableLinkedList.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/CursorableLinkedList.java?rev=1101912&r1=1101911&r2=1101912&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/CursorableLinkedList.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/CursorableLinkedList.java
Wed May 11 14:59:52 2011
@@ -1113,7 +1113,7 @@ class CursorableLinkedList<E> implements
         }
     }
 
-    public class Cursor extends ListIter implements ListIterator<E> {
+    public class Cursor extends ListIter {
         boolean _valid = false;
 
         Cursor(int index) {
@@ -1208,7 +1208,7 @@ class CursorableLinkedList<E> implements
 
 }
 
-class CursorableSubList<E> extends CursorableLinkedList<E> implements List<E>
{
+class CursorableSubList<E> extends CursorableLinkedList<E> {
 
     private static final long serialVersionUID = 1L;
 

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java?rev=1101912&r1=1101911&r2=1101912&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
Wed May 11 14:59:52 2011
@@ -41,7 +41,7 @@ import org.apache.commons.pool2.Poolable
  * @version $Revision$ $Date$
  * @since Pool 1.0
  */
-public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> implements
ObjectPool<T> {
+public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> {
     /**
      * Create a <code>SoftReferenceObjectPool</code> without a factory.
      * {@link #setFactory(PoolableObjectFactory) setFactory} should be called

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java?rev=1101912&r1=1101911&r2=1101912&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java
Wed May 11 14:59:52 2011
@@ -24,7 +24,6 @@ import java.util.NoSuchElementException;
 import java.util.Stack;
 
 import org.apache.commons.pool2.BaseKeyedObjectPool;
-import org.apache.commons.pool2.KeyedObjectPool;
 import org.apache.commons.pool2.KeyedPoolableObjectFactory;
 import org.apache.commons.pool2.PoolUtils;
 
@@ -50,7 +49,7 @@ import org.apache.commons.pool2.PoolUtil
  * @see Stack
  * @since Pool 1.0
  */
-public class StackKeyedObjectPool<K,V> extends BaseKeyedObjectPool<K,V> implements
KeyedObjectPool<K,V> {
+public class StackKeyedObjectPool<K,V> extends BaseKeyedObjectPool<K,V> {
     /**
      * Create a new pool using no factory.
      * Clients must first set the {@link #setFactory factory} or
@@ -148,7 +147,7 @@ public class StackKeyedObjectPool<K,V> e
         assertOpen();
         Stack<V> stack = _pools.get(key);
         if(null == stack) {
-            stack = new Stack();
+            stack = new Stack<V>();
             stack.ensureCapacity( _initSleepingCapacity > _maxSleeping ? _maxSleeping
: _initSleepingCapacity);
             _pools.put(key,stack);
         }
@@ -581,7 +580,7 @@ public class StackKeyedObjectPool<K,V> e
      * @return the _activeCount
      * @since 1.5.5
      */
-    public Map getActiveCount() {
+    public Map<K,Integer> getActiveCount() {
         return _activeCount;
     }
 

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java?rev=1101912&r1=1101911&r2=1101912&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
Wed May 11 14:59:52 2011
@@ -34,39 +34,6 @@ import org.apache.commons.pool2.Poolable
  * @since Pool 1.0
  */
 public class StackObjectPoolFactory<T> implements ObjectPoolFactory<T> {
-    /**
-     * Create a new StackObjectPoolFactory.
-     *
-     * @see StackObjectPool#StackObjectPool()
-     * @deprecated to be removed in pool 2.0 - use {@link #StackObjectPoolFactory(PoolableObjectFactory)}
-     */
-    public StackObjectPoolFactory() {
-        this((PoolableObjectFactory<T>)null,StackObjectPool.DEFAULT_MAX_SLEEPING,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
-    }
-
-    /**
-     * Create a new StackObjectPoolFactory.
-     *
-     * @param maxIdle cap on the number of "sleeping" instances in the pool.
-     * @see StackObjectPool#StackObjectPool(int)
-     * @deprecated to be removed in pool 2.0 - use {@link #StackObjectPoolFactory(PoolableObjectFactory,
int)}
-     */
-    public StackObjectPoolFactory(int maxIdle) {
-        this((PoolableObjectFactory<T>)null,maxIdle,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
-    }
-
-    /**
-     * Create a new StackObjectPoolFactory.
-     *
-     * @param maxIdle cap on the number of "sleeping" instances in the pool.
-     * @param initIdleCapacity - initial size of the pool (this specifies the size of the
container,
-     * it does not cause the pool to be pre-populated.)
-     * @see StackObjectPool#StackObjectPool(int, int)
-     * @deprecated to be removed in pool 2.0 - use {@link #StackObjectPoolFactory(PoolableObjectFactory,
int, int)}
-     */
-    public StackObjectPoolFactory(int maxIdle, int initIdleCapacity) {
-        this((PoolableObjectFactory<T>)null,maxIdle,initIdleCapacity);
-    }
 
     /**
      * Create a new StackObjectPoolFactory.

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackObjectPoolFactory.java?rev=1101912&r1=1101911&r2=1101912&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackObjectPoolFactory.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackObjectPoolFactory.java
Wed May 11 14:59:52 2011
@@ -40,22 +40,11 @@ public class TestStackObjectPoolFactory 
 
     @Test
     public void testConstructors() throws Exception {
-        StackObjectPoolFactory<Object> factory = new StackObjectPoolFactory<Object>();
-        factory.createPool().close();
-
-        
-        factory = new StackObjectPoolFactory<Object>(1);
-        StackObjectPool<Object> pool = (StackObjectPool<Object>)factory.createPool();
-        pool.close();
-
-
-        factory = new StackObjectPoolFactory<Object>(1, 1);
-        pool = (StackObjectPool<Object>)factory.createPool();
-        pool.close();
-
-
-        factory = new StackObjectPoolFactory<Object>(new MethodCallPoolableObjectFactory(),
1);
-        pool = (StackObjectPool<Object>)factory.createPool();
+        StackObjectPoolFactory<Object> factory =
+            new StackObjectPoolFactory<Object>(
+                    new MethodCallPoolableObjectFactory(), 1);
+        StackObjectPool<Object> pool =
+            (StackObjectPool<Object>)factory.createPool();
         Object a = pool.borrowObject();
         Object b = pool.borrowObject();
         pool.returnObject(a);



Mime
View raw message