commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1221705 [5/9] - in /commons/proper/pool/branches/POOL_1_X: ./ src/java/org/apache/commons/pool/ src/java/org/apache/commons/pool/impl/ src/site/ src/site/xdoc/ src/test/org/apache/commons/pool/ src/test/org/apache/commons/pool/impl/ src/te...
Date Wed, 21 Dec 2011 13:03:55 GMT
Modified: commons/proper/pool/branches/POOL_1_X/src/site/xdoc/examples.xml
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/site/xdoc/examples.xml?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/site/xdoc/examples.xml (original)
+++ commons/proper/pool/branches/POOL_1_X/src/site/xdoc/examples.xml Wed Dec 21 13:03:54 2011
@@ -80,9 +80,9 @@ import java.io.Reader; 
 import java.io.IOException; 
  
 public class ReaderUtil { 
-    private ObjectPool pool;
+    private ObjectPool<StringBuffer> pool;
  
-    public ReaderUtil(ObjectPool pool) { 
+    public ReaderUtil(ObjectPool<StringBuffer> pool) { 
         this.pool = pool;
     } 
  
@@ -93,7 +93,7 @@ public class ReaderUtil { 
     public String readToString(Reader in) throws IOException { 
         StringBuffer buf = null;
         try { 
-            buf = (StringBuffer)(pool.borrowObject());
+            buf = pool.borrowObject();
             for(int c = in.read(); c != -1; c = in.read()) { 
                 buf.append((char)c); 
             } 
@@ -148,16 +148,15 @@ public class ReaderUtil { 
 <source>
 import org.apache.commons.pool.BasePoolableObjectFactory; 
  
-public class StringBufferFactory extends BasePoolableObjectFactory { 
+public class StringBufferFactory extends BasePoolableObjectFactory&lt;StringBuffer&gt; { 
     // for makeObject we'll simply return a new buffer 
-    public Object makeObject() { 
+    public StringBuffer makeObject() { 
         return new StringBuffer(); 
     } 
      
     // when an object is returned to the pool,  
     // we'll clear it out 
-    public void passivateObject(Object obj) { 
-        StringBuffer buf = (StringBuffer)obj; 
+    public void passivateObject(StringBuffer buf) { 
         buf.setLength(0); 
     } 
      
@@ -170,7 +169,7 @@ public class StringBufferFactory extends
        We can, for example, use this factory with the <code>StackObjectPool</code> to instantiate our
        <code>ReaderUtil</code> as follows:
       </p>
-<source>new ReaderUtil(new StackObjectPool(new StringBufferFactory()))</source>
+<source>new ReaderUtil(new StackObjectPool&lt;StringBuffer&gt;(new StringBufferFactory()))</source>
       </section>
    </body>
 </document>

Modified: commons/proper/pool/branches/POOL_1_X/src/site/xdoc/index.xml
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/site/xdoc/index.xml?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/site/xdoc/index.xml (original)
+++ commons/proper/pool/branches/POOL_1_X/src/site/xdoc/index.xml Wed Dec 21 13:03:54 2011
@@ -61,9 +61,9 @@
              defines a trivially simple pooling interface:
           </p>
 <source>
-public interface ObjectPool {
-    Object borrowObject();
-    void returnObject(Object borrowed);
+public interface ObjectPool&lt;T&gt; {
+    T borrowObject();
+    void returnObject(T borrowed);
 }
 </source>           
           <p>
@@ -82,9 +82,9 @@ public interface ObjectPool {
              defines a similar interface for pools composed of heterogeneous objects:
           </p>
 <source>
-public interface KeyedObjectPool {
-    Object borrowObject(Object key);
-    void returnObject(Object key, Object borrowed);
+public interface KeyedObjectPool&lt;K, V&gt; {
+    V borrowObject(K key);
+    void returnObject(K key, V borrowed);
 }
 </source>           
         </subsection>
@@ -96,12 +96,12 @@ public interface KeyedObjectPool {
              supports this by providing a generic interface for the lifecycle of a pooled object:
           </p>
 <source>
-public interface PoolableObjectFactory {
-    Object makeObject();
-    void activateObject(Object obj);
-    void passivateObject(Object obj);
-    boolean validateObject(Object obj);
-    void destroyObject(Object obj);
+public interface PoolableObjectFactory&lt;T&gt; {
+    T makeObject();
+    void activateObject(T obj);
+    void passivateObject(T obj);
+    boolean validateObject(T obj);
+    void destroyObject(T obj);
 }
 </source>           
           <p>
@@ -120,12 +120,12 @@ public interface PoolableObjectFactory {
              defines a similar interface for <code>KeyedObjectPool</code>s:
           </p>
 <source>
-public interface KeyedPoolableObjectFactory {
-    Object makeObject(Object key);
-    void activateObject(Object key, Object obj);
-    void passivateObject(Object key, Object obj);
-    boolean validateObject(Object key, Object obj);
-    void destroyObject(Object key, Object obj);
+public interface KeyedPoolableObjectFactory&lt;K, V&gt; {
+    V makeObject(K key);
+    void activateObject(K key, V obj);
+    void passivateObject(K key, V obj);
+    boolean validateObject(K key, V obj);
+    void destroyObject(K key, V obj);
 }
 </source>           
           <p>

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCall.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCall.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCall.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCall.java Wed Dec 21 13:03:54 2011
@@ -29,7 +29,7 @@ import java.util.Arrays;
  */
 public class MethodCall {
     private final String name;
-    private final List params;
+    private final List<?> params;
     private Object returned;
 
     public MethodCall(final String name) {
@@ -44,7 +44,7 @@ public class MethodCall {
         this(name, Arrays.asList(new Object[] {param1, param2}));
     }
 
-    public MethodCall(final String name, final List params) {
+    public MethodCall(final String name, final List<?> params) {
         if (name == null) {
             throw new IllegalArgumentException("name must not be null.");
         }
@@ -60,7 +60,7 @@ public class MethodCall {
         return name;
     }
 
-    public List getParams() {
+    public List<?> getParams() {
         return params;
     }
 

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCallPoolableObjectFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCallPoolableObjectFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCallPoolableObjectFactory.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCallPoolableObjectFactory.java Wed Dec 21 13:03:54 2011
@@ -27,8 +27,8 @@ import java.util.ArrayList;
  * @version $Revision$ $Date$
  * @see MethodCall
  */
-public class MethodCallPoolableObjectFactory implements PoolableObjectFactory {
-    private final List methodCalls = new ArrayList();
+public class MethodCallPoolableObjectFactory implements PoolableObjectFactory<Integer> {
+    private final List<MethodCall> methodCalls = new ArrayList<MethodCall>();
     private int count = 0;
     private boolean valid = true;
     private boolean makeObjectFail;
@@ -48,7 +48,7 @@ public class MethodCallPoolableObjectFac
         setDestroyObjectFail(false);
     }
 
-    public List getMethodCalls() {
+    public List<MethodCall> getMethodCalls() {
         return methodCalls;
     }
 
@@ -108,7 +108,7 @@ public class MethodCallPoolableObjectFac
         this.passivateObjectFail = passivateObjectFail;
     }
 
-    public Object makeObject() throws Exception {
+    public Integer makeObject() throws Exception {
         final MethodCall call = new MethodCall("makeObject");
         methodCalls.add(call);
         int count = this.count++;
@@ -120,14 +120,14 @@ public class MethodCallPoolableObjectFac
         return obj;
     }
 
-    public void activateObject(final Object obj) throws Exception {
+    public void activateObject(final Integer obj) throws Exception {
         methodCalls.add(new MethodCall("activateObject", obj));
         if (activateObjectFail) {
             throw new PrivateException("activateObject");
         }
     }
 
-    public boolean validateObject(final Object obj) {
+    public boolean validateObject(final Integer obj) {
         final MethodCall call = new MethodCall("validateObject", obj);
         methodCalls.add(call);
         if (validateObjectFail) {
@@ -138,14 +138,14 @@ public class MethodCallPoolableObjectFac
         return r;
     }
 
-    public void passivateObject(final Object obj) throws Exception {
+    public void passivateObject(final Integer obj) throws Exception {
         methodCalls.add(new MethodCall("passivateObject", obj));
         if (passivateObjectFail) {
             throw new PrivateException("passivateObject");
         }
     }
 
-    public void destroyObject(final Object obj) throws Exception {
+    public void destroyObject(final Integer obj) throws Exception {
         methodCalls.add(new MethodCall("destroyObject", obj));
         if (destroyObjectFail) {
             throw new PrivateException("destroyObject");

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java Wed Dec 21 13:03:54 2011
@@ -22,14 +22,14 @@ package org.apache.commons.pool;
  * @author Sandy McArthur
  * @version $Revision$ $Date$
  */
-public class TestBaseKeyedObjectPool extends TestKeyedObjectPool {
-    private KeyedObjectPool _pool = null;
+public class TestBaseKeyedObjectPool<K, V> extends TestKeyedObjectPool {
+    private KeyedObjectPool<K, V> _pool = null;
 
     public TestBaseKeyedObjectPool(final String testName) {
         super(testName);
     }
 
-    protected KeyedObjectPool makeEmptyPool(KeyedPoolableObjectFactory factory) {
+    protected KeyedObjectPool<Object, Integer> makeEmptyPool(KeyedPoolableObjectFactory<Object, Integer> factory) {
         if (this.getClass() != TestBaseKeyedObjectPool.class) {
             fail("Subclasses of TestBaseKeyedObjectPool must reimplement this method.");
         }
@@ -43,7 +43,7 @@ public class TestBaseKeyedObjectPool ext
      * throw {@link IllegalArgumentException}
      * if such a pool cannot be created.
      */
-    protected KeyedObjectPool makeEmptyPool(int mincapacity) {
+    protected KeyedObjectPool<K, V> makeEmptyPool(int mincapacity) {
         if (this.getClass() != TestBaseKeyedObjectPool.class) {
             fail("Subclasses of TestBaseKeyedObjectPool must reimplement this method.");
         }
@@ -55,14 +55,14 @@ public class TestBaseKeyedObjectPool ext
      * object (zero indexed) created by the pool
      * for the given key.
      */
-    protected Object getNthObject(Object key, int n) {
+    protected V getNthObject(Object key, int n) {
         if (this.getClass() != TestBaseKeyedObjectPool.class) {
             fail("Subclasses of TestBaseKeyedObjectPool must reimplement this method.");
         }
         throw new UnsupportedOperationException("BaseKeyedObjectPool isn't a complete implementation.");
     }
 
-    protected Object makeKey(int n) {
+    protected K makeKey(int n) {
         if (this.getClass() != TestBaseKeyedObjectPool.class) {
             fail("Subclasses of TestBaseKeyedObjectPool must reimplement this method.");
         }
@@ -82,13 +82,13 @@ public class TestBaseKeyedObjectPool ext
         if (!getClass().equals(TestBaseKeyedObjectPool.class)) {
             return; // skip redundant tests
         }
-        KeyedObjectPool pool = new BaseKeyedObjectPool() { 
-            public Object borrowObject(Object key) {
+        KeyedObjectPool<String, String> pool = new BaseKeyedObjectPool<String, String>() { 
+            public String borrowObject(String key) {
                 return null;
             }
-            public void returnObject(Object key, Object obj) {
+            public void returnObject(String key, String obj) {
             }
-            public void invalidateObject(Object key, Object obj) {
+            public void invalidateObject(String key, String obj) {
             }            
         };
         
@@ -149,12 +149,12 @@ public class TestBaseKeyedObjectPool ext
         } catch(UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
-        Object obj0 = _pool.borrowObject(keya);
+        K keya = makeKey(0);
+        V obj0 = _pool.borrowObject(keya);
         assertEquals(getNthObject(keya,0),obj0);
-        Object obj1 = _pool.borrowObject(keya);
+        V obj1 = _pool.borrowObject(keya);
         assertEquals(getNthObject(keya,1),obj1);
-        Object obj2 = _pool.borrowObject(keya);
+        V obj2 = _pool.borrowObject(keya);
         assertEquals(getNthObject(keya,2),obj2);
         _pool.returnObject(keya,obj2);
         obj2 = _pool.borrowObject(keya);
@@ -186,8 +186,8 @@ public class TestBaseKeyedObjectPool ext
         } catch(UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
-        Object keyb = makeKey(1);
+        K keya = makeKey(0);
+        K keyb = makeKey(1);
         assertEquals("1",getNthObject(keya,0),_pool.borrowObject(keya));
         assertEquals("2",getNthObject(keyb,0),_pool.borrowObject(keyb));
         assertEquals("3",getNthObject(keyb,1),_pool.borrowObject(keyb));
@@ -202,13 +202,13 @@ public class TestBaseKeyedObjectPool ext
         } catch(UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
+        K keya = makeKey(0);
         assertEquals(0,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj0 = _pool.borrowObject(keya);
+        V obj0 = _pool.borrowObject(keya);
         assertEquals(1,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj1 = _pool.borrowObject(keya);
+        V obj1 = _pool.borrowObject(keya);
         assertEquals(2,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
         _pool.returnObject(keya,obj1);
@@ -218,8 +218,11 @@ public class TestBaseKeyedObjectPool ext
         assertEquals(0,_pool.getNumActive(keya));
         assertEquals(2,_pool.getNumIdle(keya));
 
-        assertEquals(0,_pool.getNumActive("xyzzy12345"));
-        assertEquals(0,_pool.getNumIdle("xyzzy12345"));
+        // cast to KeyedObjectPool to use the wrong key type.
+        @SuppressWarnings("unchecked")
+        final KeyedObjectPool<Object, V> rawPool = (KeyedObjectPool<Object, V>)_pool;
+        assertEquals(0,rawPool.getNumActive("xyzzy12345"));
+        assertEquals(0,rawPool.getNumIdle("xyzzy12345"));
     }
 
     public void testBaseNumActiveNumIdle2() throws Exception {
@@ -228,8 +231,8 @@ public class TestBaseKeyedObjectPool ext
         } catch(UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
-        Object keyb = makeKey(1);
+        K keya = makeKey(0);
+        K keyb = makeKey(1);
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
         assertEquals(0,_pool.getNumActive(keya));
@@ -237,8 +240,8 @@ public class TestBaseKeyedObjectPool ext
         assertEquals(0,_pool.getNumActive(keyb));
         assertEquals(0,_pool.getNumIdle(keyb));
 
-        Object objA0 = _pool.borrowObject(keya);
-        Object objB0 = _pool.borrowObject(keyb);
+        V objA0 = _pool.borrowObject(keya);
+        V objB0 = _pool.borrowObject(keyb);
 
         assertEquals(2,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
@@ -247,8 +250,8 @@ public class TestBaseKeyedObjectPool ext
         assertEquals(1,_pool.getNumActive(keyb));
         assertEquals(0,_pool.getNumIdle(keyb));
 
-        Object objA1 = _pool.borrowObject(keya);
-        Object objB1 = _pool.borrowObject(keyb);
+        V objA1 = _pool.borrowObject(keya);
+        V objB1 = _pool.borrowObject(keyb);
 
         assertEquals(4,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
@@ -284,11 +287,11 @@ public class TestBaseKeyedObjectPool ext
         } catch(UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
+        K keya = makeKey(0);
         assertEquals(0,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj0 = _pool.borrowObject(keya);
-        Object obj1 = _pool.borrowObject(keya);
+        V obj0 = _pool.borrowObject(keya);
+        V obj1 = _pool.borrowObject(keya);
         assertEquals(2,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
         _pool.returnObject(keya,obj1);
@@ -308,11 +311,11 @@ public class TestBaseKeyedObjectPool ext
         } catch(UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object keya = makeKey(0);
+        K keya = makeKey(0);
         assertEquals(0,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
-        Object obj0 = _pool.borrowObject(keya);
-        Object obj1 = _pool.borrowObject(keya);
+        V obj0 = _pool.borrowObject(keya);
+        V obj1 = _pool.borrowObject(keya);
         assertEquals(2,_pool.getNumActive(keya));
         assertEquals(0,_pool.getNumIdle(keya));
         _pool.invalidateObject(keya,obj0);
@@ -329,7 +332,7 @@ public class TestBaseKeyedObjectPool ext
         } catch(UnsupportedOperationException uoe) {
             return; // skip this test if unsupported
         }
-        Object key = makeKey(0);
+        K key = makeKey(0);
         try {
             assertEquals(0,_pool.getNumIdle());
             assertEquals(0,_pool.getNumActive());
@@ -340,7 +343,7 @@ public class TestBaseKeyedObjectPool ext
             assertEquals(0,_pool.getNumActive());
             assertEquals(1,_pool.getNumIdle(key));
             assertEquals(0,_pool.getNumActive(key));
-            Object obj = _pool.borrowObject(key);
+            V obj = _pool.borrowObject(key);
             assertEquals(getNthObject(key,0),obj);
             assertEquals(0,_pool.getNumIdle());
             assertEquals(1,_pool.getNumActive());

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedPoolableObjectFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedPoolableObjectFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedPoolableObjectFactory.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedPoolableObjectFactory.java Wed Dec 21 13:03:54 2011
@@ -28,8 +28,8 @@ public class TestBaseKeyedPoolableObject
     }
 
     public void testDefaultMethods() throws Exception {
-        KeyedPoolableObjectFactory factory = new BaseKeyedPoolableObjectFactory() { 
-            public Object makeObject(Object key) throws Exception {
+        KeyedPoolableObjectFactory<String, Object> factory = new BaseKeyedPoolableObjectFactory<String, Object>() { 
+            public Object makeObject(String key) throws Exception {
                 return null;
             }
         };   

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseObjectPool.java Wed Dec 21 13:03:54 2011
@@ -22,28 +22,28 @@ package org.apache.commons.pool;
  * @author Sandy McArthur
  * @version $Revision$ $Date$ 
  */
-public class TestBaseObjectPool extends TestObjectPool {
-    private ObjectPool _pool = null;
+public class TestBaseObjectPool<T> extends TestObjectPool {
+    private ObjectPool<T> _pool = null;
 
     public TestBaseObjectPool(String testName) {
         super(testName);
     }
 
-    protected ObjectPool makeEmptyPool(int mincapacity) {
+    protected ObjectPool<T> makeEmptyPool(int mincapacity) {
         if (this.getClass() != TestBaseObjectPool.class) {
             fail("Subclasses of TestBaseObjectPool must reimplement this method.");
         }
         throw new UnsupportedOperationException("BaseObjectPool isn't a complete implementation.");
     }
 
-    protected ObjectPool makeEmptyPool(final PoolableObjectFactory factory) {
+    protected ObjectPool<Integer> makeEmptyPool(final PoolableObjectFactory<Integer> factory) {
         if (this.getClass() != TestBaseObjectPool.class) {
             fail("Subclasses of TestBaseObjectPool must reimplement this method.");
         }
         throw new UnsupportedOperationException("BaseObjectPool isn't a complete implementation.");
     }
 
-    protected Object getNthObject(final int n) {
+    protected T getNthObject(final int n) {
         if (this.getClass() != TestBaseObjectPool.class) {
             fail("Subclasses of TestBaseObjectPool must reimplement this method.");
         }
@@ -69,7 +69,7 @@ public class TestBaseObjectPool extends 
         if (!getClass().equals(TestBaseObjectPool.class)) {
             return; // skip redundant tests
         }
-        ObjectPool pool = new BaseObjectPool() { 
+        ObjectPool<Object> pool = new BaseObjectPool<Object>() { 
             public Object borrowObject() {
                 return null;
             }
@@ -105,7 +105,7 @@ public class TestBaseObjectPool extends 
     }
 
     public void testClose() throws Exception {
-        ObjectPool pool = new BaseObjectPool() {
+        ObjectPool<Object> pool = new BaseObjectPool<Object>() {
             public Object borrowObject() {
                 return null;
             }
@@ -142,7 +142,7 @@ public class TestBaseObjectPool extends 
             _pool.addObject();
             assertEquals(1,_pool.getNumIdle());
             assertEquals(0,_pool.getNumActive());
-            Object obj = _pool.borrowObject();
+            T obj = _pool.borrowObject();
             assertEquals(getNthObject(0),obj);
             assertEquals(0,_pool.getNumIdle());
             assertEquals(1,_pool.getNumActive());
@@ -160,11 +160,11 @@ public class TestBaseObjectPool extends 
         } catch(UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
-        Object obj0 = _pool.borrowObject();
+        T obj0 = _pool.borrowObject();
         assertEquals(getNthObject(0),obj0);
-        Object obj1 = _pool.borrowObject();
+        T obj1 = _pool.borrowObject();
         assertEquals(getNthObject(1),obj1);
-        Object obj2 = _pool.borrowObject();
+        T obj2 = _pool.borrowObject();
         assertEquals(getNthObject(2),obj2);
         _pool.returnObject(obj2);
         obj2 = _pool.borrowObject();
@@ -199,10 +199,10 @@ public class TestBaseObjectPool extends 
         }
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        Object obj0 = _pool.borrowObject();
+        T obj0 = _pool.borrowObject();
         assertEquals(1,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        Object obj1 = _pool.borrowObject();
+        T obj1 = _pool.borrowObject();
         assertEquals(2,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
         _pool.returnObject(obj1);
@@ -221,8 +221,8 @@ public class TestBaseObjectPool extends 
         }
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        Object obj0 = _pool.borrowObject();
-        Object obj1 = _pool.borrowObject();
+        T obj0 = _pool.borrowObject();
+        T obj1 = _pool.borrowObject();
         assertEquals(2,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
         _pool.returnObject(obj1);
@@ -244,8 +244,8 @@ public class TestBaseObjectPool extends 
         }
         assertEquals(0,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
-        Object obj0 = _pool.borrowObject();
-        Object obj1 = _pool.borrowObject();
+        T obj0 = _pool.borrowObject();
+        T obj1 = _pool.borrowObject();
         assertEquals(2,_pool.getNumActive());
         assertEquals(0,_pool.getNumIdle());
         _pool.invalidateObject(obj0);
@@ -262,7 +262,7 @@ public class TestBaseObjectPool extends 
         } catch(UnsupportedOperationException e) {
             return; // skip this test if unsupported
         }
-        Object obj = _pool.borrowObject();
+        T obj = _pool.borrowObject();
         _pool.returnObject(obj);
 
         _pool.close();

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBasePoolableObjectFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBasePoolableObjectFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBasePoolableObjectFactory.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBasePoolableObjectFactory.java Wed Dec 21 13:03:54 2011
@@ -28,7 +28,7 @@ public class TestBasePoolableObjectFacto
     }
 
     public void testDefaultMethods() throws Exception {
-        PoolableObjectFactory factory = new BasePoolableObjectFactory() { 
+        PoolableObjectFactory<Object> factory = new BasePoolableObjectFactory<Object>() { 
             public Object makeObject() throws Exception {
                 return null;
             }

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPool.java Wed Dec 21 13:03:54 2011
@@ -42,24 +42,24 @@ public abstract class TestKeyedObjectPoo
      * behaviors described in {@link KeyedObjectPool}.
      * Generally speaking there should be no limits on the various object counts.
      */
-    protected abstract KeyedObjectPool makeEmptyPool(KeyedPoolableObjectFactory factory);
+    protected abstract KeyedObjectPool<Object, Integer> makeEmptyPool(KeyedPoolableObjectFactory<Object, Integer> factory);
 
     protected final String KEY = "key";
 
     public void testClosedPoolBehavior() throws Exception {
-        final KeyedObjectPool pool;
+        final KeyedObjectPool<Object, Integer> pool;
         try {
-            pool = makeEmptyPool(new BaseKeyedPoolableObjectFactory() {
-                public Object makeObject(final Object key) throws Exception {
-                    return new Object();
+            pool = makeEmptyPool(new BaseKeyedPoolableObjectFactory<Object, Integer>() {
+                public Integer makeObject(final Object key) throws Exception {
+                    return new Integer(1234567890);
                 }
             });
         } catch(UnsupportedOperationException uoe) {
             return; // test not supported
         }
 
-        Object o1 = pool.borrowObject(KEY);
-        Object o2 = pool.borrowObject(KEY);
+        Integer o1 = pool.borrowObject(KEY);
+        Integer o2 = pool.borrowObject(KEY);
 
         pool.close();
 
@@ -96,13 +96,13 @@ public abstract class TestKeyedObjectPoo
 
     public void testKPOFAddObjectUsage() throws Exception {
         final FailingKeyedPoolableObjectFactory factory = new FailingKeyedPoolableObjectFactory();
-        final KeyedObjectPool pool;
+        final KeyedObjectPool<Object, Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch(UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
 
         // addObject should make a new object, pasivate it and put it in the pool
         pool.addObject(KEY);
@@ -150,17 +150,17 @@ public abstract class TestKeyedObjectPoo
 
     public void testKPOFBorrowObjectUsages() throws Exception {
         final FailingKeyedPoolableObjectFactory factory = new FailingKeyedPoolableObjectFactory();
-        final KeyedObjectPool pool;
+        final KeyedObjectPool<Object, Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch(UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
-        Object obj;
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
+        Integer obj;
         
         if (pool instanceof GenericKeyedObjectPool) {
-            ((GenericKeyedObjectPool) pool).setTestOnBorrow(true);
+            ((GenericKeyedObjectPool<Object, Integer>) pool).setTestOnBorrow(true);
         }
 
         /// Test correct behavior code paths
@@ -236,14 +236,14 @@ public abstract class TestKeyedObjectPoo
 
     public void testKPOFReturnObjectUsages() throws Exception {
         final FailingKeyedPoolableObjectFactory factory = new FailingKeyedPoolableObjectFactory();
-        final KeyedObjectPool pool;
+        final KeyedObjectPool<Object, Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch(UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
-        Object obj;
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
+        Integer obj;
 
         /// Test correct behavior code paths
         obj = pool.borrowObject(KEY);
@@ -300,14 +300,14 @@ public abstract class TestKeyedObjectPoo
 
     public void testKPOFInvalidateObjectUsages() throws Exception {
         final FailingKeyedPoolableObjectFactory factory = new FailingKeyedPoolableObjectFactory();
-        final KeyedObjectPool pool;
+        final KeyedObjectPool<Object, Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch(UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
-        Object obj;
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
+        Integer obj;
 
         /// Test correct behavior code paths
 
@@ -337,13 +337,13 @@ public abstract class TestKeyedObjectPoo
 
     public void testKPOFClearUsages() throws Exception {
         final FailingKeyedPoolableObjectFactory factory = new FailingKeyedPoolableObjectFactory();
-        final KeyedObjectPool pool;
+        final KeyedObjectPool<Object, Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch(UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
 
         /// Test correct behavior code paths
         PoolUtils.prefill(pool, KEY, 5);
@@ -358,13 +358,13 @@ public abstract class TestKeyedObjectPoo
 
     public void testKPOFCloseUsages() throws Exception {
         final FailingKeyedPoolableObjectFactory factory = new FailingKeyedPoolableObjectFactory();
-        KeyedObjectPool pool;
+        KeyedObjectPool<Object, Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch(UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
 
         /// Test correct behavior code paths
         PoolUtils.prefill(pool, KEY, 5);
@@ -388,19 +388,19 @@ public abstract class TestKeyedObjectPoo
         }
     }
 
-    private void reset(final KeyedObjectPool pool, final FailingKeyedPoolableObjectFactory factory, final List expectedMethods) throws Exception {
+    private void reset(final KeyedObjectPool<? ,?> pool, final FailingKeyedPoolableObjectFactory factory, final List<MethodCall> expectedMethods) throws Exception {
         pool.clear();
         clear(factory, expectedMethods);
         factory.reset();
     }
 
-    private void clear(final FailingKeyedPoolableObjectFactory factory, final List expectedMethods) {
+    private void clear(final FailingKeyedPoolableObjectFactory factory, final List<MethodCall> expectedMethods) {
         factory.getMethodCalls().clear();
         expectedMethods.clear();
     }
 
-    protected static class FailingKeyedPoolableObjectFactory implements KeyedPoolableObjectFactory {
-        private final List methodCalls = new ArrayList();
+    protected static class FailingKeyedPoolableObjectFactory implements KeyedPoolableObjectFactory<Object, Integer> {
+        private final List<MethodCall> methodCalls = new ArrayList<MethodCall>();
         private int count = 0;
         private boolean makeObjectFail;
         private boolean activateObjectFail;
@@ -421,7 +421,7 @@ public abstract class TestKeyedObjectPoo
             setDestroyObjectFail(false);
         }
 
-        public List getMethodCalls() {
+        public List<MethodCall> getMethodCalls() {
             return methodCalls;
         }
 
@@ -473,7 +473,7 @@ public abstract class TestKeyedObjectPoo
             this.passivateObjectFail = passivateObjectFail;
         }
 
-        public Object makeObject(final Object key) throws Exception {
+        public Integer makeObject(final Object key) throws Exception {
             final MethodCall call = new MethodCall("makeObject", key);
             methodCalls.add(call);
             int count = this.count++;
@@ -485,14 +485,14 @@ public abstract class TestKeyedObjectPoo
             return obj;
         }
 
-        public void activateObject(final Object key, final Object obj) throws Exception {
+        public void activateObject(final Object key, final Integer obj) throws Exception {
             methodCalls.add(new MethodCall("activateObject", key, obj));
             if (activateObjectFail) {
                 throw new PrivateException("activateObject");
             }
         }
 
-        public boolean validateObject(final Object key, final Object obj) {
+        public boolean validateObject(final Object key, final Integer obj) {
             final MethodCall call = new MethodCall("validateObject", key, obj);
             methodCalls.add(call);
             if (validateObjectFail) {
@@ -503,14 +503,14 @@ public abstract class TestKeyedObjectPoo
             return r;
         }
 
-        public void passivateObject(final Object key, final Object obj) throws Exception {
+        public void passivateObject(final Object key, final Integer obj) throws Exception {
             methodCalls.add(new MethodCall("passivateObject", key, obj));
             if (passivateObjectFail) {
                 throw new PrivateException("passivateObject");
             }
         }
 
-        public void destroyObject(final Object key, final Object obj) throws Exception {
+        public void destroyObject(final Object key, final Integer obj) throws Exception {
             methodCalls.add(new MethodCall("destroyObject", key, obj));
             if (destroyObjectFail) {
                 throw new PrivateException("destroyObject");

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPoolFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPoolFactory.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPoolFactory.java Wed Dec 21 13:03:54 2011
@@ -33,32 +33,32 @@ public abstract class TestKeyedObjectPoo
     /**
      * @throws UnsupportedOperationException when this is unsupported by this KeyedPoolableObjectFactory type.
      */
-    protected KeyedObjectPoolFactory makeFactory() throws UnsupportedOperationException {
+    protected KeyedObjectPoolFactory<Object, Integer> makeFactory() throws UnsupportedOperationException {
         return makeFactory(createObjectFactory());
     }
 
     /**
      * @throws UnsupportedOperationException when this is unsupported by this KeyedPoolableObjectFactory type.
      */
-    protected abstract KeyedObjectPoolFactory makeFactory(KeyedPoolableObjectFactory objectFactory) throws UnsupportedOperationException;
+    protected abstract KeyedObjectPoolFactory<Object, Integer> makeFactory(KeyedPoolableObjectFactory<Object, Integer> objectFactory) throws UnsupportedOperationException;
 
-    protected static KeyedPoolableObjectFactory createObjectFactory() {
+    protected static KeyedPoolableObjectFactory<Object, Integer> createObjectFactory() {
         return PoolUtils.adapt(new MethodCallPoolableObjectFactory());
     }
 
     public void testCreatePool() throws Exception {
-        final KeyedObjectPoolFactory factory;
+        final KeyedObjectPoolFactory<?, Integer> factory;
         try {
             factory = makeFactory();
         } catch (UnsupportedOperationException uoe) {
             return;
         }
-        final KeyedObjectPool pool = factory.createPool();
+        final KeyedObjectPool<?, Integer> pool = factory.createPool();
         pool.close();
     }
 
     public void testToString() {
-        final KeyedObjectPoolFactory factory;
+        final KeyedObjectPoolFactory<?, Integer> factory;
         try {
             factory = makeFactory();
         } catch (UnsupportedOperationException uoe) {

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPool.java Wed Dec 21 13:03:54 2011
@@ -44,17 +44,17 @@ public abstract class TestObjectPool ext
      * Generally speaking there should be no limits on the various object counts.
      * @throws UnsupportedOperationException if the pool being tested does not follow pool contracts.
      */
-    protected abstract ObjectPool makeEmptyPool(PoolableObjectFactory factory) throws UnsupportedOperationException;
+    protected abstract ObjectPool<Integer> makeEmptyPool(PoolableObjectFactory<Integer> factory) throws UnsupportedOperationException;
 
     public void testClosedPoolBehavior() throws Exception {
-        final ObjectPool pool;
+        final ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(new MethodCallPoolableObjectFactory());
         } catch (UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        Object o1 = pool.borrowObject();
-        Object o2 = pool.borrowObject();
+        Integer o1 = pool.borrowObject();
+        Integer o2 = pool.borrowObject();
 
         pool.close();
 
@@ -102,13 +102,13 @@ public abstract class TestObjectPool ext
 
     public void testPOFAddObjectUsage() throws Exception {
         final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
-        final ObjectPool pool;
+        final ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch(UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
 
         assertEquals(0, pool.getNumActive());
         assertEquals(0, pool.getNumIdle());
@@ -164,17 +164,17 @@ public abstract class TestObjectPool ext
 
     public void testPOFBorrowObjectUsages() throws Exception {
         final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
-        final ObjectPool pool;
+        final ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch (UnsupportedOperationException uoe) {
             return; // test not supported
         }
         if (pool instanceof GenericObjectPool) {
-            ((GenericObjectPool) pool).setTestOnBorrow(true);
+            ((GenericObjectPool<Integer>) pool).setTestOnBorrow(true);
         }
-        final List expectedMethods = new ArrayList();
-        Object obj;
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
+        Integer obj;
 
         /// Test correct behavior code paths
 
@@ -246,14 +246,14 @@ public abstract class TestObjectPool ext
 
     public void testPOFReturnObjectUsages() throws Exception {
         final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
-        final ObjectPool pool;
+        final ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch (UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
-        Object obj;
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
+        Integer obj;
 
         /// Test correct behavior code paths
         obj = pool.borrowObject();
@@ -307,14 +307,14 @@ public abstract class TestObjectPool ext
 
     public void testPOFInvalidateObjectUsages() throws Exception {
         final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
-        final ObjectPool pool;
+        final ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch (UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
-        Object obj;
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
+        Integer obj;
 
         /// Test correct behavior code paths
 
@@ -344,13 +344,13 @@ public abstract class TestObjectPool ext
 
     public void testPOFClearUsages() throws Exception {
         final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
-        final ObjectPool pool;
+        final ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch (UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
 
         /// Test correct behavior code paths
         PoolUtils.prefill(pool, 5);
@@ -365,13 +365,13 @@ public abstract class TestObjectPool ext
 
     public void testPOFCloseUsages() throws Exception {
         final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
-        ObjectPool pool;
+        ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(factory);
         } catch (UnsupportedOperationException uoe) {
             return; // test not supported
         }
-        final List expectedMethods = new ArrayList();
+        final List<MethodCall> expectedMethods = new ArrayList<MethodCall>();
 
         /// Test correct behavior code paths
         PoolUtils.prefill(pool, 5);
@@ -391,7 +391,7 @@ public abstract class TestObjectPool ext
     }
 
     public void testSetFactory() throws Exception {
-        ObjectPool pool;
+        ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(new MethodCallPoolableObjectFactory());
         } catch (UnsupportedOperationException uoe) {
@@ -406,7 +406,7 @@ public abstract class TestObjectPool ext
     }
 
     public void testToString() {
-        ObjectPool pool;
+        ObjectPool<Integer> pool;
         try {
             pool = makeEmptyPool(new MethodCallPoolableObjectFactory());
         } catch (UnsupportedOperationException uoe) {
@@ -415,23 +415,23 @@ public abstract class TestObjectPool ext
         pool.toString();
     }
 
-    static void removeDestroyObjectCall(List calls) {
-        Iterator iter = calls.iterator();
+    static void removeDestroyObjectCall(List<MethodCall> calls) {
+        Iterator<MethodCall> iter = calls.iterator();
         while (iter.hasNext()) {
-            MethodCall call = (MethodCall)iter.next();
+            MethodCall call = iter.next();
             if ("destroyObject".equals(call.getName())) {
                 iter.remove();
             }
         }
     }
 
-    private static void reset(final ObjectPool pool, final MethodCallPoolableObjectFactory factory, final List expectedMethods) throws Exception {
+    private static void reset(final ObjectPool<?> pool, final MethodCallPoolableObjectFactory factory, final List<MethodCall> expectedMethods) throws Exception {
         pool.clear();
         clear(factory, expectedMethods);
         factory.reset();
     }
 
-    private static void clear(final MethodCallPoolableObjectFactory factory, final List expectedMethods) {
+    private static void clear(final MethodCallPoolableObjectFactory factory, final List<MethodCall> expectedMethods) {
         factory.getMethodCalls().clear();
         expectedMethods.clear();
     }

Modified: commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPoolFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPoolFactory.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPoolFactory.java Wed Dec 21 13:03:54 2011
@@ -33,28 +33,28 @@ public abstract class TestObjectPoolFact
     /**
      * @throws UnsupportedOperationException when this is unsupported by this PoolableObjectFactory type.
      */
-    protected ObjectPoolFactory makeFactory() throws UnsupportedOperationException {
+    protected ObjectPoolFactory<Integer> makeFactory() throws UnsupportedOperationException {
         return makeFactory(new MethodCallPoolableObjectFactory());
     }
 
     /**
      * @throws UnsupportedOperationException when this is unsupported by this PoolableObjectFactory type.
      */
-    protected abstract ObjectPoolFactory makeFactory(PoolableObjectFactory objectFactory) throws UnsupportedOperationException;
+    protected abstract ObjectPoolFactory<Integer> makeFactory(PoolableObjectFactory<Integer> objectFactory) throws UnsupportedOperationException;
 
     public void testCreatePool() throws Exception {
-        final ObjectPoolFactory factory;
+        final ObjectPoolFactory<Integer> factory;
         try {
             factory = makeFactory();
         } catch (UnsupportedOperationException uoe) {
             return;
         }
-        final ObjectPool pool = factory.createPool();
+        final ObjectPool<Integer> pool = factory.createPool();
         pool.close();
     }
 
     public void testToString() {
-        final ObjectPoolFactory factory;
+        final ObjectPoolFactory<Integer> factory;
         try {
             factory = makeFactory();
         } catch (UnsupportedOperationException uoe) {



Mime
View raw message