commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1221705 [3/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/java/org/apache/commons/pool/impl/CursorableLinkedList.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java Wed Dec 21 13:03:54 2011
@@ -59,7 +59,7 @@ import java.lang.ref.WeakReference;
  * @author Janek Bogucki
  * @author Simon Kitching
  */
-class CursorableLinkedList implements List, Serializable {
+class CursorableLinkedList<E> implements List<E>, Serializable {
     /** Ensure serialization compatibility */
     private static final long serialVersionUID = 8836393098519411393L;
 
@@ -72,7 +72,7 @@ class CursorableLinkedList implements Li
      * @param o element to be appended to this list.
      * @return <tt>true</tt>
      */
-    public boolean add(Object o) {
+    public boolean add(E o) {
         insertListable(_head.prev(),null,o);
         return true;
     }
@@ -92,15 +92,15 @@ class CursorableLinkedList implements Li
      * @throws IndexOutOfBoundsException if the index is out of range
      *         (index &lt; 0 || index &gt; size()).
      */
-    public void add(int index, Object element) {
+    public void add(int index, E element) {
         if(index == _size) {
             add(element);
         } else {
             if(index < 0 || index > _size) {
                 throw new IndexOutOfBoundsException(String.valueOf(index) + " < 0 or " + String.valueOf(index) + " > " + _size);
             }
-            Listable succ = (isEmpty() ? null : getListableAt(index));
-            Listable pred = (null == succ ? null : succ.prev());
+            Listable<E> succ = (isEmpty() ? null : getListableAt(index));
+            Listable<E> pred = (null == succ ? null : succ.prev());
             insertListable(pred,succ,element);
         }
     }
@@ -122,11 +122,11 @@ class CursorableLinkedList implements Li
      *         specified collection prevents it from being added to this
      *         list.
      */
-    public boolean addAll(Collection c) {
+    public boolean addAll(Collection<? extends E> c) {
         if(c.isEmpty()) {
             return false;
         }
-        Iterator it = c.iterator();
+        Iterator<? extends E> it = c.iterator();
         while(it.hasNext()) {
             insertListable(_head.prev(),null,it.next());
         }
@@ -158,15 +158,15 @@ class CursorableLinkedList implements Li
      * @throws IndexOutOfBoundsException if the index is out of range (index
      *         &lt; 0 || index &gt; size()).
      */
-    public boolean addAll(int index, Collection c) {
+    public boolean addAll(int index, Collection<? extends E> c) {
         if(c.isEmpty()) {
             return false;
         } else if(_size == index || _size == 0) {
             return addAll(c);
         } else {
-            Listable succ = getListableAt(index);
-            Listable pred = (null == succ) ? null : succ.prev();
-            Iterator it = c.iterator();
+            Listable<E> succ = getListableAt(index);
+            Listable<E> pred = (null == succ) ? null : succ.prev();
+            Iterator<? extends E> it = c.iterator();
             while(it.hasNext()) {
                 pred = insertListable(pred,succ,it.next());
             }
@@ -181,7 +181,7 @@ class CursorableLinkedList implements Li
      * @param o element to be prepended to this list.
      * @return <tt>true</tt>
      */
-    public boolean addFirst(Object o) {
+    public boolean addFirst(E o) {
         insertListable(null,_head.next(),o);
         return true;
     }
@@ -193,7 +193,7 @@ class CursorableLinkedList implements Li
      * @param o element to be appended to this list.
      * @return <tt>true</tt>
      */
-    public boolean addLast(Object o) {
+    public boolean addLast(E o) {
         insertListable(_head.prev(),null,o);
         return true;
     }
@@ -212,7 +212,7 @@ class CursorableLinkedList implements Li
         _head.setPrev(null);
         _size = 0;
         */
-        Iterator it = iterator();
+        Iterator<E> it = iterator();
         while(it.hasNext()) {
             it.next();
             it.remove();
@@ -229,7 +229,7 @@ class CursorableLinkedList implements Li
      * @return <tt>true</tt> if this list contains the specified element.
      */
     public boolean contains(Object o) {
-        for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+        for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
             if((null == o && null == elt.value()) ||
                (o != null && o.equals(elt.value()))) {
                 return true;
@@ -246,8 +246,8 @@ class CursorableLinkedList implements Li
      * @return <tt>true</tt> if this list contains all of the elements of the
      *         specified collection.
      */
-    public boolean containsAll(Collection c) {
-        Iterator it = c.iterator();
+    public boolean containsAll(Collection<?> c) {
+        Iterator<?> it = c.iterator();
         while(it.hasNext()) {
             if(!this.contains(it.next())) {
                 return false;
@@ -281,7 +281,7 @@ class CursorableLinkedList implements Li
      * @see #listIterator()
      * @see CursorableLinkedList.Cursor
      */
-    public CursorableLinkedList.Cursor cursor() {
+    public CursorableLinkedList<E>.Cursor cursor() {
         return new Cursor(0);
     }
 
@@ -301,7 +301,7 @@ class CursorableLinkedList implements Li
      * @throws IndexOutOfBoundsException if the index is out of range (index
      *          &lt; 0 || index &gt; size()).
      */
-    public CursorableLinkedList.Cursor cursor(int i) {
+    public CursorableLinkedList<E>.Cursor cursor(int i) {
         return new Cursor(i);
     }
 
@@ -325,8 +325,8 @@ class CursorableLinkedList implements Li
         } else if(!(o instanceof List)) {
             return false;
         }
-        Iterator it = ((List)o).listIterator();
-        for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+        Iterator<?> it = ((List<?>)o).listIterator();
+        for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
             if(!it.hasNext() || (null == elt.value() ? null != it.next() : !(elt.value().equals(it.next()))) ) {
                 return false;
             }
@@ -343,14 +343,14 @@ class CursorableLinkedList implements Li
      * @throws IndexOutOfBoundsException if the index is out of range (index
      *         &lt; 0 || index &gt;= size()).
      */
-    public Object get(int index) {
+    public E get(int index) {
         return getListableAt(index).value();
     }
 
     /**
      * Returns the element at the beginning of this list.
      */
-    public Object getFirst() {
+    public E getFirst() {
         try {
             return _head.next().value();
         } catch(NullPointerException e) {
@@ -361,7 +361,7 @@ class CursorableLinkedList implements Li
     /**
      * Returns the element at the end of this list.
      */
-    public Object getLast() {
+    public E getLast() {
         try {
             return _head.prev().value();
         } catch(NullPointerException e) {
@@ -392,7 +392,7 @@ class CursorableLinkedList implements Li
      */
     public int hashCode() {
         int hash = 1;
-        for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+        for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
             hash = 31*hash + (null == elt.value() ? 0 : elt.value().hashCode());
         }
         return hash;
@@ -415,7 +415,7 @@ class CursorableLinkedList implements Li
         // perform the null check outside of the loop to save checking every
         // single time through the loop.
         if (null == o) {
-            for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+            for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
                 if (null == elt.value()) {
                     return ndx;
                 }
@@ -423,7 +423,7 @@ class CursorableLinkedList implements Li
             }
         } else {
 
-            for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+            for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
                 if (o.equals(elt.value())) {
                     return ndx;
                 }
@@ -445,7 +445,7 @@ class CursorableLinkedList implements Li
      * Returns a fail-fast iterator.
      * @see List#iterator
      */
-    public Iterator iterator() {
+    public Iterator<E> iterator() {
         return listIterator(0);
     }
 
@@ -466,14 +466,14 @@ class CursorableLinkedList implements Li
         // perform the null check outside of the loop to save checking every
         // single time through the loop.
         if (null == o) {
-            for(Listable elt = _head.prev(), past = null; null != elt && past != _head.next(); elt = (past = elt).prev()) {
+            for(Listable<E> elt = _head.prev(), past = null; null != elt && past != _head.next(); elt = (past = elt).prev()) {
                 if (null == elt.value()) {
                     return ndx;
                 }
                 ndx--;
             }
         } else {
-            for(Listable elt = _head.prev(), past = null; null != elt && past != _head.next(); elt = (past = elt).prev()) {
+            for(Listable<E> elt = _head.prev(), past = null; null != elt && past != _head.next(); elt = (past = elt).prev()) {
                 if (o.equals(elt.value())) {
                     return ndx;
                 }
@@ -487,7 +487,7 @@ class CursorableLinkedList implements Li
      * Returns a fail-fast ListIterator.
      * @see List#listIterator()
      */
-    public ListIterator listIterator() {
+    public ListIterator<E> listIterator() {
         return listIterator(0);
     }
 
@@ -495,7 +495,7 @@ class CursorableLinkedList implements Li
      * Returns a fail-fast ListIterator.
      * @see List#listIterator(int)
      */
-    public ListIterator listIterator(int index) {
+    public ListIterator<E> listIterator(int index) {
         if(index<0 || index > _size) {
             throw new IndexOutOfBoundsException(index + " < 0 or > " + _size);
         }
@@ -513,7 +513,7 @@ class CursorableLinkedList implements Li
      * @return <tt>true</tt> if this list contained the specified element.
      */
     public boolean remove(Object o) {
-        for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+        for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
             if(null == o && null == elt.value()) {
                 removeListable(elt);
                 return true;
@@ -537,9 +537,9 @@ class CursorableLinkedList implements Li
      * @throws IndexOutOfBoundsException if the index is out of range (index
      *            &lt; 0 || index &gt;= size()).
      */
-    public Object remove(int index) {
-        Listable elt = getListableAt(index);
-        Object ret = elt.value();
+    public E remove(int index) {
+        Listable<E> elt = getListableAt(index);
+        E ret = elt.value();
         removeListable(elt);
         return ret;
     }
@@ -552,12 +552,12 @@ class CursorableLinkedList implements Li
      *          this list.
      * @return <tt>true</tt> if this list changed as a result of the call.
      */
-    public boolean removeAll(Collection c) {
+    public boolean removeAll(Collection<?> c) {
         if(0 == c.size() || 0 == _size) {
             return false;
         } else {
             boolean changed = false;
-            Iterator it = iterator();
+            Iterator<?> it = iterator();
             while(it.hasNext()) {
                 if(c.contains(it.next())) {
                     it.remove();
@@ -571,9 +571,9 @@ class CursorableLinkedList implements Li
     /**
      * Removes the first element of this list, if any.
      */
-    public Object removeFirst() {
+    public E removeFirst() {
         if(_head.next() != null) {
-            Object val = _head.next().value();
+            E val = _head.next().value();
             removeListable(_head.next());
             return val;
         } else {
@@ -584,9 +584,9 @@ class CursorableLinkedList implements Li
     /**
      * Removes the last element of this list, if any.
      */
-    public Object removeLast() {
+    public E removeLast() {
         if(_head.prev() != null) {
-            Object val = _head.prev().value();
+            E val = _head.prev().value();
             removeListable(_head.prev());
             return val;
         } else {
@@ -604,9 +604,9 @@ class CursorableLinkedList implements Li
      *
      * @return <tt>true</tt> if this list changed as a result of the call.
      */
-    public boolean retainAll(Collection c) {
+    public boolean retainAll(Collection<?> c) {
         boolean changed = false;
-        Iterator it = iterator();
+        Iterator<?> it = iterator();
         while(it.hasNext()) {
             if(!c.contains(it.next())) {
                 it.remove();
@@ -631,9 +631,9 @@ class CursorableLinkedList implements Li
      * @throws IndexOutOfBoundsException if the index is out of range
      *         (index &lt; 0 || index &gt;= size()).
      */
-    public Object set(int index, Object element) {
-        Listable elt = getListableAt(index);
-        Object val = elt.setValue(element);
+    public E set(int index, E element) {
+        Listable<E> elt = getListableAt(index);
+        E val = elt.setValue(element);
         broadcastListableChanged(elt);
         return val;
     }
@@ -656,7 +656,7 @@ class CursorableLinkedList implements Li
     public Object[] toArray() {
         Object[] array = new Object[_size];
         int i = 0;
-        for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+        for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
             array[i++] = elt.value();
         }
         return array;
@@ -677,13 +677,14 @@ class CursorableLinkedList implements Li
      *                   is not a supertype of the runtime type of every element in
      *                   this list.
      */
-    public Object[] toArray(Object a[]) {
+    @SuppressWarnings("unchecked")
+    public <T> T[] toArray(T a[]) {
         if(a.length < _size) {
-            a = (Object[])Array.newInstance(a.getClass().getComponentType(), _size);
+            a = (T[])Array.newInstance(a.getClass().getComponentType(), _size);
         }
         int i = 0;
-        for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
-            a[i++] = elt.value();
+        for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+            a[i++] = (T) elt.value();
         }
         if(a.length > _size) {
             a[_size] = null; // should we null out the rest of the array also? java.util.LinkedList doesn't
@@ -698,7 +699,7 @@ class CursorableLinkedList implements Li
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("[");
-        for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
+        for(Listable<E> elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
             if(_head.next() != elt) {
                 buf.append(", ");
             }
@@ -712,13 +713,13 @@ class CursorableLinkedList implements Li
      * Returns a fail-fast sublist.
      * @see List#subList(int,int)
      */
-    public List subList(int i, int j) {
+    public List<E> subList(int i, int j) {
         if(i < 0 || j > _size || i > j) {
             throw new IndexOutOfBoundsException();
         } else if(i == 0 && j == _size) {
             return this;
         } else {
-            return new CursorableSubList(this,i,j);
+            return new CursorableSubList<E>(this,i,j);
         }
     }
 
@@ -732,10 +733,10 @@ class CursorableLinkedList implements Li
      * @return the newly created
      * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
      */
-    protected Listable insertListable(Listable before, Listable after, Object value) {
+    protected Listable<E> insertListable(Listable<E> before, Listable<E> after, E value) {
         _modCount++;
         _size++;
-        Listable elt = new Listable(before,after,value);
+        Listable<E> elt = new Listable<E>(before,after,value);
         if(null != before) {
             before.setNext(elt);
         } else {
@@ -756,7 +757,7 @@ class CursorableLinkedList implements Li
      * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
      * from my list.
      */
-    protected void removeListable(Listable elt) {
+    protected void removeListable(Listable<E> elt) {
         _modCount++;
         _size--;
         if(_head.next() == elt) {
@@ -782,18 +783,18 @@ class CursorableLinkedList implements Li
      * @throws IndexOutOfBoundsException if index is less than zero or
      *         greater than or equal to the size of this list.
      */
-    protected Listable getListableAt(int index) {
+    protected Listable<E> getListableAt(int index) {
         if(index < 0 || index >= _size) {
             throw new IndexOutOfBoundsException(String.valueOf(index) + " < 0 or " + String.valueOf(index) + " >= " + _size);
         }
         if(index <=_size/2) {
-            Listable elt = _head.next();
+            Listable<E> elt = _head.next();
             for(int i = 0; i < index; i++) {
                 elt = elt.next();
             }
             return elt;
         } else {
-            Listable elt = _head.prev();
+            Listable<E> elt = _head.prev();
             for(int i = (_size-1); i > index; i--) {
                 elt = elt.prev();
             }
@@ -808,14 +809,14 @@ class CursorableLinkedList implements Li
     protected void registerCursor(Cursor cur) {
         // We take this opportunity to clean the _cursors list
         // of WeakReference objects to garbage-collected cursors.
-        for (Iterator it = _cursors.iterator(); it.hasNext(); ) {
-            WeakReference ref = (WeakReference) it.next();
+        for (Iterator<WeakReference<Cursor>> it = _cursors.iterator(); it.hasNext(); ) {
+            WeakReference<Cursor> ref = it.next();
             if (ref.get() == null) {
                 it.remove();
             }
         }
 
-        _cursors.add( new WeakReference(cur) );
+        _cursors.add( new WeakReference<Cursor>(cur) );
     }
 
     /**
@@ -823,9 +824,9 @@ class CursorableLinkedList implements Li
      * the set of cursors to be notified of changes to this list.
      */
     protected void unregisterCursor(Cursor cur) {
-        for (Iterator it = _cursors.iterator(); it.hasNext(); ) {
-            WeakReference ref = (WeakReference) it.next();
-            Cursor cursor = (Cursor) ref.get();
+        for (Iterator<WeakReference<Cursor>> it = _cursors.iterator(); it.hasNext(); ) {
+            WeakReference<Cursor> ref = it.next();
+            Cursor cursor = ref.get();
             if (cursor == null) {
                 // some other unrelated cursor object has been
                 // garbage-collected; let's take the opportunity to
@@ -845,10 +846,10 @@ class CursorableLinkedList implements Li
      * invalid.
      */
     protected void invalidateCursors() {
-        Iterator it = _cursors.iterator();
+        Iterator<WeakReference<Cursor>> it = _cursors.iterator();
         while (it.hasNext()) {
-            WeakReference ref = (WeakReference) it.next();
-            Cursor cursor = (Cursor) ref.get();
+            WeakReference<Cursor> ref = it.next();
+            Cursor cursor = ref.get();
             if (cursor != null) {
                 // cursor is null if object has been garbage-collected
                 cursor.invalidate();
@@ -863,11 +864,11 @@ class CursorableLinkedList implements Li
      * element was changed.
      * @see #set(int,java.lang.Object)
      */
-    protected void broadcastListableChanged(Listable elt) {
-        Iterator it = _cursors.iterator();
+    protected void broadcastListableChanged(Listable<E> elt) {
+        Iterator<WeakReference<Cursor>> it = _cursors.iterator();
         while (it.hasNext()) {
-            WeakReference ref = (WeakReference) it.next();
-            Cursor cursor = (Cursor) ref.get();
+            WeakReference<Cursor> ref = it.next();
+            Cursor cursor = ref.get();
             if (cursor == null) {
                 it.remove(); // clean up list
             } else {
@@ -880,11 +881,11 @@ class CursorableLinkedList implements Li
      * Informs all of my registered cursors that the specified
      * element was just removed from my list.
      */
-    protected void broadcastListableRemoved(Listable elt) {
-        Iterator it = _cursors.iterator();
+    protected void broadcastListableRemoved(Listable<E> elt) {
+        Iterator<WeakReference<Cursor>> it = _cursors.iterator();
         while (it.hasNext()) {
-            WeakReference ref = (WeakReference) it.next();
-            Cursor cursor = (Cursor) ref.get();
+            WeakReference<Cursor> ref = it.next();
+            Cursor cursor = ref.get();
             if (cursor == null) {
                 it.remove(); // clean up list
             } else {
@@ -897,11 +898,11 @@ class CursorableLinkedList implements Li
      * Informs all of my registered cursors that the specified
      * element was just added to my list.
      */
-    protected void broadcastListableInserted(Listable elt) {
-        Iterator it = _cursors.iterator();
+    protected void broadcastListableInserted(Listable<E> elt) {
+        Iterator<WeakReference<Cursor>> it = _cursors.iterator();
         while (it.hasNext()) {
-            WeakReference ref = (WeakReference) it.next();
-            Cursor cursor = (Cursor) ref.get();
+            WeakReference<Cursor> ref = it.next();
+            Cursor cursor = ref.get();
             if (cursor == null) {
                 it.remove();  // clean up list
             } else {
@@ -913,22 +914,23 @@ class CursorableLinkedList implements Li
     private void writeObject(ObjectOutputStream out) throws IOException {
         out.defaultWriteObject();
         out.writeInt(_size);
-        Listable cur = _head.next();
+        Listable<E> cur = _head.next();
         while (cur != null) {
             out.writeObject(cur.value());
             cur = cur.next();
         }
     }
 
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
         in.defaultReadObject();
         _size = 0;
         _modCount = 0;
-        _cursors = new ArrayList();
-        _head = new Listable(null,null,null);
+        _cursors = new ArrayList<WeakReference<Cursor>>();
+        _head = new Listable<E>(null,null,null);
         int size = in.readInt();
         for (int i=0;i<size;i++) {
-            this.add(in.readObject());
+            this.add((E)in.readObject());
         }
     }
 
@@ -949,7 +951,7 @@ class CursorableLinkedList implements Li
      * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
      * is the first or last element in the list.
      */
-    protected transient Listable _head = new Listable(null,null,null);
+    protected transient Listable<E> _head = new Listable<E>(null,null,null);
 
     /** Tracks the number of structural modifications to me. */
     protected transient int _modCount = 0;
@@ -958,74 +960,74 @@ class CursorableLinkedList implements Li
      * A list of the currently {@link CursorableLinkedList.Cursor}s currently
      * open in this list.
      */
-    protected transient List _cursors = new ArrayList();
+    protected transient List<WeakReference<Cursor>> _cursors = new ArrayList<WeakReference<Cursor>>();
 
     //--- inner classes ----------------------------------------------
 
-    static class Listable implements Serializable {
-        private Listable _prev = null;
-        private Listable _next = null;
-        private Object _val = null;
+    static class Listable<E> implements Serializable {
+        private Listable<E> _prev = null;
+        private Listable<E> _next = null;
+        private E _val = null;
 
-        Listable(Listable prev, Listable next, Object val) {
+        Listable(Listable<E> prev, Listable<E> next, E val) {
             _prev = prev;
             _next = next;
             _val = val;
         }
 
-        Listable next() {
+        Listable<E> next() {
             return _next;
         }
 
-        Listable prev() {
+        Listable<E> prev() {
             return _prev;
         }
 
-        Object value() {
+        E value() {
             return _val;
         }
 
-        void setNext(Listable next) {
+        void setNext(Listable<E> next) {
             _next = next;
         }
 
-        void setPrev(Listable prev) {
+        void setPrev(Listable<E> prev) {
             _prev = prev;
         }
 
-        Object setValue(Object val) {
-            Object temp = _val;
+        E setValue(E val) {
+            E temp = _val;
             _val = val;
             return temp;
         }
     }
 
-    class ListIter implements ListIterator {
-        Listable _cur = null;
-        Listable _lastReturned = null;
+    class ListIter implements ListIterator<E> {
+        Listable<E> _cur = null;
+        Listable<E> _lastReturned = null;
         int _expectedModCount = _modCount;
         int _nextIndex = 0;
 
         ListIter(int index) {
             if(index == 0) {
-                _cur = new Listable(null,_head.next(),null);
+                _cur = new Listable<E>(null,_head.next(),null);
                 _nextIndex = 0;
             } else if(index == _size) {
-                _cur = new Listable(_head.prev(),null,null);
+                _cur = new Listable<E>(_head.prev(),null,null);
                 _nextIndex = _size;
             } else {
-                Listable temp = getListableAt(index);
-                _cur = new Listable(temp.prev(),temp,null);
+                Listable<E> temp = getListableAt(index);
+                _cur = new Listable<E>(temp.prev(),temp,null);
                 _nextIndex = index;
             }
         }
 
-        public Object previous() {
+        public E previous() {
             checkForComod();
             if(!hasPrevious()) {
                 throw new NoSuchElementException();
             } else {
-                Object ret = _cur.prev().value();
+                E ret = _cur.prev().value();
                 _lastReturned = _cur.prev();
                 _cur.setNext(_cur.prev());
                 _cur.setPrev(_cur.prev().prev());
@@ -1039,12 +1041,12 @@ class CursorableLinkedList implements Li
             return(null != _cur.next() && _cur.prev() != _head.prev());
         }
 
-        public Object next() {
+        public E next() {
             checkForComod();
             if(!hasNext()) {
                 throw new NoSuchElementException();
             } else {
-                Object ret = _cur.next().value();
+                E ret = _cur.next().value();
                 _lastReturned = _cur.next();
                 _cur.setPrev(_cur.next());
                 _cur.setNext(_cur.next().next());
@@ -1066,7 +1068,7 @@ class CursorableLinkedList implements Li
             return(null != _cur.prev() && _cur.next() != _head.next());
         }
 
-        public void set(Object o) {
+        public void set(E o) {
             checkForComod();
             try {
                 _lastReturned.setValue(o);
@@ -1097,7 +1099,7 @@ class CursorableLinkedList implements Li
             }
         }
 
-        public void add(Object o) {
+        public void add(E o) {
             checkForComod();
             _cur.setPrev(insertListable(_cur.prev(),_cur.next(),o));
             _lastReturned = null;
@@ -1112,7 +1114,7 @@ class CursorableLinkedList implements Li
         }
     }
 
-    public class Cursor extends ListIter implements ListIterator {
+    public class Cursor extends ListIter implements ListIterator<E> {
         boolean _valid = false;
 
         Cursor(int index) {
@@ -1129,9 +1131,9 @@ class CursorableLinkedList implements Li
             throw new UnsupportedOperationException();
         }
 
-        public void add(Object o) {
+        public void add(E o) {
             checkForComod();
-            Listable elt = insertListable(_cur.prev(),_cur.next(),o);
+            Listable<E> elt = insertListable(_cur.prev(),_cur.next(),o);
             _cur.setPrev(elt);
             _cur.setNext(elt.next());
             _lastReturned = null;
@@ -1139,7 +1141,7 @@ class CursorableLinkedList implements Li
             _expectedModCount++;
         }
 
-        protected void listableRemoved(Listable elt) {
+        protected void listableRemoved(Listable<E> elt) {
             if(null == _head.prev()) {
                 _cur.setNext(null);
             } else if(_cur.next() == elt) {
@@ -1155,7 +1157,7 @@ class CursorableLinkedList implements Li
             }
         }
 
-        protected void listableInserted(Listable elt) {
+        protected void listableInserted(Listable<E> elt) {
             if(null == _cur.next() && null == _cur.prev()) {
                 _cur.setNext(elt);
             } else if(_cur.prev() == elt.prev()) {
@@ -1169,7 +1171,7 @@ class CursorableLinkedList implements Li
             }
         }
 
-        protected void listableChanged(Listable elt) {
+        protected void listableChanged(Listable<E> elt) {
             if(_lastReturned == elt) {
                 _lastReturned = null;
             }
@@ -1203,11 +1205,11 @@ class CursorableLinkedList implements Li
 
 }
 
-class CursorableSubList extends CursorableLinkedList implements List {
+class CursorableSubList<E> extends CursorableLinkedList<E> implements List<E> {
 
     //--- constructors -----------------------------------------------
 
-    CursorableSubList(CursorableLinkedList list, int from, int to) {
+    CursorableSubList(CursorableLinkedList<E> list, int from, int to) {
         if(0 > from || list.size() < to) {
             throw new IndexOutOfBoundsException();
         } else if(from > to) {
@@ -1240,14 +1242,14 @@ class CursorableSubList extends Cursorab
 
     public void clear() {
         checkForComod();
-        Iterator it = iterator();
+        Iterator<E> it = iterator();
         while(it.hasNext()) {
             it.next();
             it.remove();
         }
     }
 
-    public Iterator iterator() {
+    public Iterator<E> iterator() {
         checkForComod();
         return super.iterator();
     }
@@ -1267,7 +1269,7 @@ class CursorableSubList extends Cursorab
         return super.toArray();
     }
 
-    public Object[] toArray(Object a[]) {
+    public <T> T[] toArray(T a[]) {
         checkForComod();
         return super.toArray(a);
     }
@@ -1282,47 +1284,47 @@ class CursorableSubList extends Cursorab
         return super.remove(o);
     }
 
-    public Object removeFirst() {
+    public E removeFirst() {
         checkForComod();
         return super.removeFirst();
     }
 
-    public Object removeLast() {
+    public E removeLast() {
         checkForComod();
         return super.removeLast();
     }
 
-    public boolean addAll(Collection c) {
+    public boolean addAll(Collection<? extends E> c) {
         checkForComod();
         return super.addAll(c);
     }
 
-    public boolean add(Object o) {
+    public boolean add(E o) {
         checkForComod();
         return super.add(o);
     }
 
-    public boolean addFirst(Object o) {
+    public boolean addFirst(E o) {
         checkForComod();
         return super.addFirst(o);
     }
 
-    public boolean addLast(Object o) {
+    public boolean addLast(E o) {
         checkForComod();
         return super.addLast(o);
     }
 
-    public boolean removeAll(Collection c) {
+    public boolean removeAll(Collection<?> c) {
         checkForComod();
         return super.removeAll(c);
     }
 
-    public boolean containsAll(Collection c) {
+    public boolean containsAll(Collection<?> c) {
         checkForComod();
         return super.containsAll(c);
     }
 
-    public boolean addAll(int index, Collection c) {
+    public boolean addAll(int index, Collection<? extends E> c) {
         checkForComod();
         return super.addAll(index,c);
     }
@@ -1332,12 +1334,12 @@ class CursorableSubList extends Cursorab
         return super.hashCode();
     }
 
-    public boolean retainAll(Collection c) {
+    public boolean retainAll(Collection<?> c) {
         checkForComod();
         return super.retainAll(c);
     }
 
-    public Object set(int index, Object element) {
+    public E set(int index, E element) {
         checkForComod();
         return super.set(index,element);
     }
@@ -1347,32 +1349,32 @@ class CursorableSubList extends Cursorab
         return super.equals(o);
     }
 
-    public Object get(int index) {
+    public E get(int index) {
         checkForComod();
         return super.get(index);
     }
 
-    public Object getFirst() {
+    public E getFirst() {
         checkForComod();
         return super.getFirst();
     }
 
-    public Object getLast() {
+    public E getLast() {
         checkForComod();
         return super.getLast();
     }
 
-    public void add(int index, Object element) {
+    public void add(int index, E element) {
         checkForComod();
         super.add(index,element);
     }
 
-    public ListIterator listIterator(int index) {
+    public ListIterator<E> listIterator(int index) {
         checkForComod();
         return super.listIterator(index);
     }
 
-    public Object remove(int index) {
+    public E remove(int index) {
         checkForComod();
         return super.remove(index);
     }
@@ -1387,12 +1389,12 @@ class CursorableSubList extends Cursorab
         return super.lastIndexOf(o);
     }
 
-    public ListIterator listIterator() {
+    public ListIterator<E> listIterator() {
         checkForComod();
         return super.listIterator();
     }
 
-    public List subList(int fromIndex, int toIndex) {
+    public List<E> subList(int fromIndex, int toIndex) {
         checkForComod();
         return super.subList(fromIndex,toIndex);
     }
@@ -1406,10 +1408,10 @@ class CursorableSubList extends Cursorab
      *
      * @return the newly created {@link CursorableLinkedList.Listable}
      */
-    protected Listable insertListable(Listable before, Listable after, Object value) {
+    protected Listable<E> insertListable(Listable<E> before, Listable<E> after, E value) {
         _modCount++;
         _size++;
-        Listable elt = _list.insertListable((null == before ? _pre : before), (null == after ? _post : after),value);
+        Listable<E> elt = _list.insertListable((null == before ? _pre : before), (null == after ? _post : after),value);
         if(null == _head.next()) {
             _head.setNext(elt);
             _head.setPrev(elt);
@@ -1427,7 +1429,7 @@ class CursorableSubList extends Cursorab
     /**
      * Removes the given {@link CursorableLinkedList.Listable} from my list.
      */
-    protected void removeListable(Listable elt) {
+    protected void removeListable(Listable<E> elt) {
         _modCount++;
         _size--;
         if(_head.next() == elt && _head.prev() == elt) {
@@ -1461,12 +1463,12 @@ class CursorableSubList extends Cursorab
     //--- protected attributes ---------------------------------------
 
     /** My underlying list */
-    protected CursorableLinkedList _list = null;
+    protected CursorableLinkedList<E> _list = null;
 
     /** The element in my underlying list preceding the first element in my list. */
-    protected Listable _pre = null;
+    protected Listable<E> _pre = null;
 
     /** The element in my underlying list following the last element in my list. */
-    protected Listable _post = null;
+    protected Listable<E> _post = null;
 
 }

Modified: commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/EvictionTimer.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/EvictionTimer.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/EvictionTimer.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/EvictionTimer.java Wed Dec 21 13:03:54 2011
@@ -62,7 +62,7 @@ class EvictionTimer {
         if (null == _timer) {
             // Force the new Timer thread to be created with a context class
             // loader set to the class loader that loaded this library
-            ClassLoader ccl = (ClassLoader) AccessController.doPrivileged(
+            ClassLoader ccl = AccessController.doPrivileged(
                     new PrivilegedGetTccl());
             try {
                 AccessController.doPrivileged(new PrivilegedSetTccl(
@@ -92,12 +92,12 @@ class EvictionTimer {
     /** 
      * {@link PrivilegedAction} used to get the ContextClassLoader
      */
-    private static class PrivilegedGetTccl implements PrivilegedAction {
+    private static class PrivilegedGetTccl implements PrivilegedAction<ClassLoader> {
 
         /** 
          * {@inheritDoc}
          */
-        public Object run() {
+        public ClassLoader run() {
             return Thread.currentThread().getContextClassLoader();
         }
     }
@@ -105,7 +105,7 @@ class EvictionTimer {
     /** 
      * {@link PrivilegedAction} used to set the ContextClassLoader
      */
-    private static class PrivilegedSetTccl implements PrivilegedAction {
+    private static class PrivilegedSetTccl implements PrivilegedAction<ClassLoader> {
 
         /** ClassLoader */
         private final ClassLoader cl;
@@ -121,7 +121,7 @@ class EvictionTimer {
         /** 
          * {@inheritDoc}
          */
-        public Object run() {
+        public ClassLoader run() {
             Thread.currentThread().setContextClassLoader(cl);
             return null;
         }

Modified: commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java Wed Dec 21 13:03:54 2011
@@ -18,17 +18,16 @@
 package org.apache.commons.pool.impl;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.NoSuchElementException;
 import java.util.Set;
-import java.util.TreeMap;
 import java.util.TimerTask;
-import java.util.Map.Entry;
+import java.util.TreeMap;
 
 import org.apache.commons.pool.BaseKeyedObjectPool;
 import org.apache.commons.pool.KeyedObjectPool;
@@ -201,7 +200,7 @@ import org.apache.commons.pool.PoolUtils
  * @version $Revision$ $Date$
  * @since Pool 1.0
  */
-public class GenericKeyedObjectPool extends BaseKeyedObjectPool implements KeyedObjectPool {
+public class GenericKeyedObjectPool<K, V> extends BaseKeyedObjectPool<K, V> implements KeyedObjectPool<K, V> {
 
     //--- public constants -------------------------------------------
 
@@ -368,7 +367,7 @@ public class GenericKeyedObjectPool exte
      * @param factory the <code>KeyedPoolableObjectFactory</code> to use to create, validate, and destroy
      * objects if not <code>null</code>
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory) {
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory) {
         this(factory, DEFAULT_MAX_ACTIVE, DEFAULT_WHEN_EXHAUSTED_ACTION, DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE,
                 DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
                 DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
@@ -380,7 +379,7 @@ public class GenericKeyedObjectPool exte
      * if not <code>null</code>
      * @param config a non-<code>null</code> {@link GenericKeyedObjectPool.Config} describing the configuration
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, GenericKeyedObjectPool.Config config) {
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, GenericKeyedObjectPool.Config config) {
         this(factory, config.maxActive, config.whenExhaustedAction, config.maxWait, config.maxIdle, config.maxTotal,
                 config.minIdle, config.testOnBorrow, config.testOnReturn, config.timeBetweenEvictionRunsMillis,
                 config.numTestsPerEvictionRun, config.minEvictableIdleTimeMillis, config.testWhileIdle, config.lifo);
@@ -392,7 +391,7 @@ public class GenericKeyedObjectPool exte
      * if not <code>null</code>
      * @param maxActive the maximum number of objects that can be borrowed from me at one time (see {@link #setMaxActive})
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive) {
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive) {
         this(factory,maxActive, DEFAULT_WHEN_EXHAUSTED_ACTION, DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE,
                 DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, 
                 DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
@@ -407,7 +406,7 @@ public class GenericKeyedObjectPool exte
      * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted and
      *  <code>whenExhaustedAction</code> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive, byte whenExhaustedAction,
             long maxWait) {
         this(factory, maxActive, whenExhaustedAction, maxWait, DEFAULT_MAX_IDLE, DEFAULT_TEST_ON_BORROW,
                 DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
@@ -427,7 +426,7 @@ public class GenericKeyedObjectPool exte
      * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject}
      * method (see {@link #setTestOnReturn})
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive, byte whenExhaustedAction,
             long maxWait, boolean testOnBorrow, boolean testOnReturn) {
         this(factory, maxActive, whenExhaustedAction, maxWait, DEFAULT_MAX_IDLE,testOnBorrow,testOnReturn,
                 DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
@@ -445,7 +444,7 @@ public class GenericKeyedObjectPool exte
      * <code>whenExhaustedAction</code> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})
      * @param maxIdle the maximum number of idle objects in my pool (see {@link #setMaxIdle})
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive, byte whenExhaustedAction,
             long maxWait, int maxIdle) {
         this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN,
                 DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
@@ -467,7 +466,7 @@ public class GenericKeyedObjectPool exte
      * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject}
      * method (see {@link #setTestOnReturn})
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive, byte whenExhaustedAction,
             long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn) {
         this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, testOnBorrow, testOnReturn,
                 DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
@@ -498,7 +497,7 @@ public class GenericKeyedObjectPool exte
      * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any
      * (see {@link #setTestWhileIdle})
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive, byte whenExhaustedAction,
             long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis,
             int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) {
         this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, GenericKeyedObjectPool.DEFAULT_MAX_TOTAL,
@@ -530,7 +529,7 @@ public class GenericKeyedObjectPool exte
      * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any
      * (see {@link #setTestWhileIdle})
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive, byte whenExhaustedAction,
             long maxWait, int maxIdle, int maxTotal, boolean testOnBorrow, boolean testOnReturn,
             long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis,
             boolean testWhileIdle) {
@@ -565,7 +564,7 @@ public class GenericKeyedObjectPool exte
      * (see {@link #setTestWhileIdle})
      * @since Pool 1.3
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive, byte whenExhaustedAction,
             long maxWait, int maxIdle, int maxTotal, int minIdle, boolean testOnBorrow, boolean testOnReturn,
             long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis,
             boolean testWhileIdle) {
@@ -601,7 +600,7 @@ public class GenericKeyedObjectPool exte
      * @param lifo whether or not the pools behave as LIFO (last in first out) queues (see {@link #setLifo})
      * @since Pool 1.4
      */
-    public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
+    public GenericKeyedObjectPool(KeyedPoolableObjectFactory<K, V> factory, int maxActive, byte whenExhaustedAction,
             long maxWait, int maxIdle, int maxTotal, int minIdle, boolean testOnBorrow, boolean testOnReturn,
             long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis,
             boolean testWhileIdle, boolean lifo) {
@@ -628,8 +627,8 @@ public class GenericKeyedObjectPool exte
         _minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
         _testWhileIdle = testWhileIdle;
 
-        _poolMap = new HashMap();
-        _poolList = new CursorableLinkedList();
+        _poolMap = new HashMap<K, ObjectQueue>();
+        _poolList = new CursorableLinkedList<K>();
 
         startEvictor(_timeBetweenEvictionRunsMillis);
     }
@@ -1085,9 +1084,9 @@ public class GenericKeyedObjectPool exte
      * @return object instance from the keyed pool
      * @throws NoSuchElementException if a keyed object instance cannot be returned.
      */
-     public Object borrowObject(Object key) throws Exception {
+     public V borrowObject(K key) throws Exception {
         long starttime = System.currentTimeMillis();
-        Latch latch = new Latch(key);
+        Latch<K, V> latch = new Latch<K, V>(key);
         byte whenExhaustedAction;
         long maxWait;
         synchronized (this) {
@@ -1213,8 +1212,8 @@ public class GenericKeyedObjectPool exte
             boolean newlyCreated = false;
             if (null == latch.getPair()) {
                 try {
-                    Object obj = _factory.makeObject(key);
-                    latch.setPair(new ObjectTimestampPair(obj));
+                    V obj = _factory.makeObject(key);
+                    latch.setPair(new ObjectTimestampPair<V>(obj));
                     newlyCreated = true;
                 } finally {
                     if (!newlyCreated) {
@@ -1280,12 +1279,12 @@ public class GenericKeyedObjectPool exte
         synchronized (this) {
             if (isClosed()) return;
             
-            Iterator allocationQueueIter = _allocationQueue.iterator();
+            Iterator<Latch<K, V>> allocationQueueIter = _allocationQueue.iterator();
             
             while (allocationQueueIter.hasNext()) {
                 // First use any objects in the pool to clear the queue
-                Latch latch = (Latch) allocationQueueIter.next();
-                ObjectQueue pool = (ObjectQueue)(_poolMap.get(latch.getkey()));
+                Latch<K, V> latch = allocationQueueIter.next();
+                ObjectQueue pool = (_poolMap.get(latch.getkey()));
                 if (null == pool) {
                     pool = new ObjectQueue();
                     _poolMap.put(latch.getkey(), pool);
@@ -1295,7 +1294,7 @@ public class GenericKeyedObjectPool exte
                 if (!pool.queue.isEmpty()) {
                     allocationQueueIter.remove();
                     latch.setPair(
-                            (ObjectTimestampPair) pool.queue.removeFirst());
+                            pool.queue.removeFirst());
                     pool.incrementInternalProcessingCount();
                     _totalIdle--;
                     synchronized (latch) {
@@ -1365,14 +1364,14 @@ public class GenericKeyedObjectPool exte
      * <li>Exceptions encountered destroying idle instances are swallowed.</li></ul></p>
      */
     public void clear() {
-        Map toDestroy = new HashMap();
+        Map<K,  List<ObjectTimestampPair<V>>> toDestroy = new HashMap<K,  List<ObjectTimestampPair<V>>>();
         synchronized (this) {
-            for (Iterator it = _poolMap.keySet().iterator(); it.hasNext();) {
-                Object key = it.next();
-                ObjectQueue pool = (ObjectQueue)_poolMap.get(key);
+            for (Iterator<K> it = _poolMap.keySet().iterator(); it.hasNext();) {
+                K key = it.next();
+                ObjectQueue pool = _poolMap.get(key);
                 // Copy objects to new list so pool.queue can be cleared inside
                 // the sync
-                List objects = new ArrayList();
+                List<ObjectTimestampPair<V>> objects = new ArrayList<ObjectTimestampPair<V>>();
                 objects.addAll(pool.queue);
                 toDestroy.put(key, objects);
                 it.remove();
@@ -1394,15 +1393,15 @@ public class GenericKeyedObjectPool exte
      */
     public void clearOldest() {
         // Map of objects to destroy my key
-        final Map toDestroy = new HashMap();
+        final Map<K, List<ObjectTimestampPair<V>>> toDestroy = new HashMap<K, List<ObjectTimestampPair<V>>>();
 
         // build sorted map of idle objects
-        final Map map = new TreeMap();
+        final Map<ObjectTimestampPair<V>, K> map = new TreeMap<ObjectTimestampPair<V>, K>();
         synchronized (this) {
-            for (Iterator keyiter = _poolMap.keySet().iterator(); keyiter.hasNext();) {
-                final Object key = keyiter.next();
-                final CursorableLinkedList list = ((ObjectQueue)_poolMap.get(key)).queue;
-                for (Iterator it = list.iterator(); it.hasNext();) {
+            for (Iterator<K> keyiter = _poolMap.keySet().iterator(); keyiter.hasNext();) {
+                final K key = keyiter.next();
+                final List<ObjectTimestampPair<V>> list = _poolMap.get(key).queue;
+                for (Iterator<ObjectTimestampPair<V>> it = list.iterator(); it.hasNext();) {
                     // each item into the map uses the objectimestamppair object
                     // as the key.  It then gets sorted based on the timstamp field
                     // each value in the map is the parent list it belongs in.
@@ -1411,25 +1410,25 @@ public class GenericKeyedObjectPool exte
             }
 
             // Now iterate created map and kill the first 15% plus one to account for zero
-            Set setPairKeys = map.entrySet();
+            Set<Entry<ObjectTimestampPair<V>, K>> setPairKeys = map.entrySet();
             int itemsToRemove = ((int) (map.size() * 0.15)) + 1;
 
-            Iterator iter = setPairKeys.iterator();
+            Iterator<Entry<ObjectTimestampPair<V>, K>> iter = setPairKeys.iterator();
             while (iter.hasNext() && itemsToRemove > 0) {
-                Map.Entry entry = (Map.Entry) iter.next();
+                Entry<ObjectTimestampPair<V>, K> entry = iter.next();
                 // kind of backwards on naming.  In the map, each key is the objecttimestamppair
                 // because it has the ordering with the timestamp value.  Each value that the
                 // key references is the key of the list it belongs to.
-                Object key = entry.getValue();
-                ObjectTimestampPair pairTimeStamp = (ObjectTimestampPair) entry.getKey();
-                ObjectQueue objectQueue = (ObjectQueue)_poolMap.get(key);
-                final CursorableLinkedList list = objectQueue.queue;
+                K key = entry.getValue();
+                ObjectTimestampPair<V> pairTimeStamp = entry.getKey();
+                ObjectQueue objectQueue = _poolMap.get(key);
+                final List<ObjectTimestampPair<V>> list = objectQueue.queue;
                 list.remove(pairTimeStamp);
 
                 if (toDestroy.containsKey(key)) {
-                    ((List)toDestroy.get(key)).add(pairTimeStamp);
+                    toDestroy.get(key).add(pairTimeStamp);
                 } else {
-                    List listForKey = new ArrayList();
+                    List<ObjectTimestampPair<V>> listForKey = new ArrayList<ObjectTimestampPair<V>>();
                     listForKey.add(pairTimeStamp);
                     toDestroy.put(key, listForKey);
                 }
@@ -1447,12 +1446,12 @@ public class GenericKeyedObjectPool exte
      *
      * @param key the key to clear
      */
-    public void clear(Object key) {
-        Map toDestroy = new HashMap();
+    public void clear(K key) {
+        Map<K, List<ObjectTimestampPair<V>>> toDestroy = new HashMap<K , List<ObjectTimestampPair<V>>>();
 
         final ObjectQueue pool;
         synchronized (this) {
-            pool = (ObjectQueue)(_poolMap.remove(key));
+            pool = _poolMap.remove(key);
             if (pool == null) {
                 return;
             } else {
@@ -1460,7 +1459,7 @@ public class GenericKeyedObjectPool exte
             }
             // Copy objects to new list so pool.queue can be cleared inside
             // the sync
-            List objects = new ArrayList();
+            List<ObjectTimestampPair<V>> objects = new ArrayList<ObjectTimestampPair<V>>();
             objects.addAll(pool.queue);
             toDestroy.put(key, objects);
             _totalIdle = _totalIdle - pool.queue.size();
@@ -1478,21 +1477,21 @@ public class GenericKeyedObjectPool exte
      * @param m Map containing keyed pools to clear
      * @param factory KeyedPoolableObjectFactory used to destroy the objects
      */
-    private void destroy(Map m, KeyedPoolableObjectFactory factory) {
-        for (Iterator entries = m.entrySet().iterator(); entries.hasNext();) {
-            Map.Entry entry = (Entry) entries.next();
-            Object key = entry.getKey();
-            Collection c = (Collection) entry.getValue();
-            for (Iterator it = c.iterator(); it.hasNext();) {
+    private void destroy(Map<K,  List<ObjectTimestampPair<V>>> m, KeyedPoolableObjectFactory<K, V> factory) {
+        for (Iterator<Entry<K,  List<ObjectTimestampPair<V>>>> entries = m.entrySet().iterator(); entries.hasNext();) {
+            Entry<K,  List<ObjectTimestampPair<V>>> entry = entries.next();
+            K key = entry.getKey();
+            List<ObjectTimestampPair<V>> c = entry.getValue();
+            for (Iterator<ObjectTimestampPair<V>> it = c.iterator(); it.hasNext();) {
                 try {
                     factory.destroyObject(
-                            key,((ObjectTimestampPair)(it.next())).value);
+                            key,it.next().value);
                 } catch(Exception e) {
                     // ignore error, keep destroying the rest
                 } finally {
                     synchronized(this) {
                         ObjectQueue objectQueue =
-                                (ObjectQueue) _poolMap.get(key);
+                                _poolMap.get(key);
                         if (objectQueue != null) {
                             objectQueue.decrementInternalProcessingCount();
                             if (objectQueue.internalProcessingCount == 0 &&
@@ -1538,7 +1537,7 @@ public class GenericKeyedObjectPool exte
      * @return the number of instances corresponding to the given <code>key</code> currently borrowed in this pool
      */
     public synchronized int getNumActive(Object key) {
-        final ObjectQueue pool = (ObjectQueue)(_poolMap.get(key));
+        final ObjectQueue pool = (_poolMap.get(key));
         return pool != null ? pool.activeCount : 0;
     }
 
@@ -1549,7 +1548,7 @@ public class GenericKeyedObjectPool exte
      * @return the number of instances corresponding to the given <code>key</code> currently idle in this pool
      */
     public synchronized int getNumIdle(Object key) {
-        final ObjectQueue pool = (ObjectQueue)(_poolMap.get(key));
+        final ObjectQueue pool = (_poolMap.get(key));
         return pool != null ? pool.queue.size() : 0;
     }
 
@@ -1571,7 +1570,7 @@ public class GenericKeyedObjectPool exte
      * @param obj instance to return to the keyed pool
      * @throws Exception
      */
-    public void returnObject(Object key, Object obj) throws Exception {
+    public void returnObject(K key, V obj) throws Exception {
         try {
             addObjectToPool(key, obj, true);
         } catch (Exception e) {
@@ -1584,7 +1583,7 @@ public class GenericKeyedObjectPool exte
                 // TODO: Correctness here depends on control in addObjectToPool.
                 // These two methods should be refactored, removing the
                 // "behavior flag", decrementNumActive, from addObjectToPool.
-                ObjectQueue pool = (ObjectQueue) (_poolMap.get(key));
+                ObjectQueue pool = (_poolMap.get(key));
                 if (pool != null) {
                     synchronized(this) {
                         pool.decrementActiveCount();
@@ -1615,7 +1614,7 @@ public class GenericKeyedObjectPool exte
      * @param decrementNumActive whether or not to decrement the active count associated with the keyed pool
      * @throws Exception
      */
-    private void addObjectToPool(Object key, Object obj,
+    private void addObjectToPool(K key, V obj,
             boolean decrementNumActive) throws Exception {
 
         // if we need to validate this object, do so
@@ -1634,7 +1633,7 @@ public class GenericKeyedObjectPool exte
         boolean doAllocate = false;
         synchronized (this) {
             // grab the pool (list) of objects associated with the given key
-            pool = (ObjectQueue) (_poolMap.get(key));
+            pool = _poolMap.get(key);
             // if it doesn't exist, create it
             if (null == pool) {
                 pool = new ObjectQueue();
@@ -1652,9 +1651,9 @@ public class GenericKeyedObjectPool exte
                     // borrowObject always takes the first element from the queue,
                     // so for LIFO, push on top, FIFO add to end
                     if (_lifo) {
-                        pool.queue.addFirst(new ObjectTimestampPair(obj));
+                        pool.queue.addFirst(new ObjectTimestampPair<V>(obj));
                     } else {
-                        pool.queue.addLast(new ObjectTimestampPair(obj));
+                        pool.queue.addLast(new ObjectTimestampPair<V>(obj));
                     }
                     _totalIdle++;
                     if (decrementNumActive) {
@@ -1700,12 +1699,12 @@ public class GenericKeyedObjectPool exte
      * @param obj instance to invalidate
      * @throws Exception if an exception occurs destroying the object
      */
-    public void invalidateObject(Object key, Object obj) throws Exception {
+    public void invalidateObject(K key, V obj) throws Exception {
         try {
             _factory.destroyObject(key, obj);
         } finally {
             synchronized (this) {
-                ObjectQueue pool = (ObjectQueue) (_poolMap.get(key));
+                ObjectQueue pool = (_poolMap.get(key));
                 if (null == pool) {
                     pool = new ObjectQueue();
                     _poolMap.put(key, pool);
@@ -1727,12 +1726,12 @@ public class GenericKeyedObjectPool exte
      * @throws IllegalStateException when no {@link #setFactory factory} has been set or after {@link #close} has been
      * called on this pool.
      */
-    public void addObject(Object key) throws Exception {
+    public void addObject(K key) throws Exception {
         assertOpen();
         if (_factory == null) {
             throw new IllegalStateException("Cannot add objects without a factory.");
         }
-        Object obj = _factory.makeObject(key);
+        V obj = _factory.makeObject(key);
         try {
             assertOpen();
             addObjectToPool(key, obj, false);
@@ -1758,8 +1757,8 @@ public class GenericKeyedObjectPool exte
      * will be populated immediately.
      * @since Pool 1.3
      */
-    public synchronized void preparePool(Object key, boolean populateImmediately) {
-        ObjectQueue pool = (ObjectQueue)(_poolMap.get(key));
+    public synchronized void preparePool(K key, boolean populateImmediately) {
+        ObjectQueue pool = (_poolMap.get(key));
         if (null == pool) {
             pool = new ObjectQueue();
             _poolMap.put(key,pool);
@@ -1802,7 +1801,7 @@ public class GenericKeyedObjectPool exte
             startEvictor(-1L);
             
             while(_allocationQueue.size() > 0) {
-                Latch l = (Latch) _allocationQueue.removeFirst();
+                Latch<K, V> l = _allocationQueue.removeFirst();
                 
                 synchronized (l) {
                     // notify the waiting thread
@@ -1823,21 +1822,21 @@ public class GenericKeyedObjectPool exte
      * @throws IllegalStateException if there are active (checked out) instances associated with this keyed object pool
      * @deprecated to be removed in version 2.0
      */
-    public void setFactory(KeyedPoolableObjectFactory factory) throws IllegalStateException {
-        Map toDestroy = new HashMap();
-        final KeyedPoolableObjectFactory oldFactory = _factory;
+    public void setFactory(KeyedPoolableObjectFactory<K, V> factory) throws IllegalStateException {
+        Map<K, List<ObjectTimestampPair<V>>> toDestroy = new HashMap<K, List<ObjectTimestampPair<V>>>();
+        final KeyedPoolableObjectFactory<K, V> oldFactory = _factory;
         synchronized (this) {
             assertOpen();
             if (0 < getNumActive()) {
                 throw new IllegalStateException("Objects are already active");
             } else {
-                for (Iterator it = _poolMap.keySet().iterator(); it.hasNext();) {
-                    Object key = it.next();
-                    ObjectQueue pool = (ObjectQueue)_poolMap.get(key);
+                for (Iterator<K> it = _poolMap.keySet().iterator(); it.hasNext();) {
+                    K key = it.next();
+                    ObjectQueue pool = _poolMap.get(key);
                     if (pool != null) {
                         // Copy objects to new list so pool.queue can be cleared
                         // inside the sync
-                        List objects = new ArrayList();
+                        List<ObjectTimestampPair<V>> objects = new ArrayList<ObjectTimestampPair<V>>();
                         objects.addAll(pool.queue);
                         toDestroy.put(key, objects);
                         it.remove();
@@ -1869,7 +1868,7 @@ public class GenericKeyedObjectPool exte
      * @throws Exception when there is a problem evicting idle objects.
      */
     public void evict() throws Exception {
-        Object key = null;
+        K key = null;
         boolean testWhileIdle;
         long minEvictableIdleTimeMillis;
 
@@ -1888,7 +1887,7 @@ public class GenericKeyedObjectPool exte
         }
 
         for (int i=0, m=getNumTests(); i<m; i++) {
-            final ObjectTimestampPair pair;
+            final ObjectTimestampPair<V> pair;
             synchronized (this) {
                 // make sure pool map is not empty; otherwise do nothing
                 if (_poolMap == null || _poolMap.size() == 0) {
@@ -1951,10 +1950,10 @@ public class GenericKeyedObjectPool exte
                 // if LIFO and the _evictionCursor has a previous object,
                 // or FIFO and _evictionCursor has a next object, test it
                 pair = _lifo ?
-                        (ObjectTimestampPair) _evictionCursor.previous() :
-                        (ObjectTimestampPair) _evictionCursor.next();
+                        _evictionCursor.previous() :
+                        _evictionCursor.next();
                 _evictionCursor.remove();
-                ObjectQueue objectQueue = (ObjectQueue) _poolMap.get(key);
+                ObjectQueue objectQueue = _poolMap.get(key);
                 objectQueue.incrementInternalProcessingCount();
                 _totalIdle--;
             }
@@ -1995,7 +1994,7 @@ public class GenericKeyedObjectPool exte
             }
             synchronized (this) {
                 ObjectQueue objectQueue =
-                    (ObjectQueue)_poolMap.get(key);
+                    _poolMap.get(key);
                 objectQueue.decrementInternalProcessingCount();
                 if (removeObject) {
                     if (objectQueue.queue.isEmpty() &&
@@ -2044,9 +2043,9 @@ public class GenericKeyedObjectPool exte
         if (_poolMap == null) {
             return;
         }
-        ObjectQueue pool = (ObjectQueue) (_poolMap.get(key));
+        ObjectQueue pool = _poolMap.get(key);
         if (pool != null) {
-            CursorableLinkedList queue = pool.queue;
+            CursorableLinkedList<ObjectTimestampPair<V>> queue = pool.queue;
             _evictionCursor = queue.cursor(_lifo ? queue.size() : 0);
         }
     }
@@ -2058,6 +2057,7 @@ public class GenericKeyedObjectPool exte
      * @see #setMinIdle
      * @throws Exception If there was an error whilst creating the pooled objects.
      */
+    @SuppressWarnings("unchecked")
     private void ensureMinIdle() throws Exception {
         //Check if should sustain the pool
         if (_minIdle > 0) {
@@ -2072,7 +2072,7 @@ public class GenericKeyedObjectPool exte
             // If the number is less than the minIdle, do creation loop to boost numbers
             for (int i=0; i < keysCopy.length; i++) {
                 //Get the next key to process
-                ensureMinIdle(keysCopy[i]);
+                ensureMinIdle((K)keysCopy[i]);
             }
         }
     }
@@ -2088,11 +2088,11 @@ public class GenericKeyedObjectPool exte
      * @param key The key to process
      * @throws Exception If there was an error whilst creating the pooled objects
      */
-    private void ensureMinIdle(Object key) throws Exception {
+    private void ensureMinIdle(K key) throws Exception {
         // Calculate current pool objects
         ObjectQueue pool;
         synchronized(this) {
-            pool = (ObjectQueue)(_poolMap.get(key));
+            pool = (_poolMap.get(key));
         }
         if (pool == null) {
             return;
@@ -2147,9 +2147,9 @@ public class GenericKeyedObjectPool exte
         StringBuffer buf = new StringBuffer();
         buf.append("Active: ").append(getNumActive()).append("\n");
         buf.append("Idle: ").append(getNumIdle()).append("\n");
-        Iterator it = _poolMap.keySet().iterator();
+        Iterator<K> it = _poolMap.keySet().iterator();
         while (it.hasNext()) {
-            Object key = it.next();
+            K key = it.next();
             buf.append("\t").append(key).append(" ").append(_poolMap.get(key)).append("\n");
         }
         return buf.toString();
@@ -2216,7 +2216,7 @@ public class GenericKeyedObjectPool exte
         private int activeCount = 0;
         
         /** Idle instance queue */
-        private final CursorableLinkedList queue = new CursorableLinkedList();
+        private final CursorableLinkedList<ObjectTimestampPair<V>> queue = new CursorableLinkedList<ObjectTimestampPair<V>>();
         
         /** Number of instances in process of being created */
         private int internalProcessingCount = 0;
@@ -2263,13 +2263,13 @@ public class GenericKeyedObjectPool exte
      *
      * This is also used by {@link GenericObjectPool}.
      */
-    static class ObjectTimestampPair implements Comparable {
+    static class ObjectTimestampPair<T> implements Comparable<T> {
         //CHECKSTYLE: stop VisibilityModifier
         /** 
          * Object instance 
          * @deprecated this field will be made private and final in version 2.0
          */
-        Object value;
+        T value;
         
         /**
          * timestamp
@@ -2282,7 +2282,7 @@ public class GenericKeyedObjectPool exte
          * Create a new ObjectTimestampPair using the given object and the current system time.
          * @param val object instance
          */
-        ObjectTimestampPair(Object val) {
+        ObjectTimestampPair(T val) {
             this(val, System.currentTimeMillis());
         }
 
@@ -2291,7 +2291,7 @@ public class GenericKeyedObjectPool exte
          * @param val object instance
          * @param time long representation of timestamp
          */
-        ObjectTimestampPair(Object val, long time) {
+        ObjectTimestampPair(T val, long time) {
             value = val;
             tstamp = time;
         }
@@ -2312,8 +2312,9 @@ public class GenericKeyedObjectPool exte
          * @param obj object to cmpare
          * @return result of comparison
          */
+        @SuppressWarnings("unchecked")
         public int compareTo(Object obj) {
-            return compareTo((ObjectTimestampPair) obj);
+            return compareTo((ObjectTimestampPair<T>) obj);
         }
 
         /**
@@ -2323,7 +2324,7 @@ public class GenericKeyedObjectPool exte
          * @param other object to compare
          * @return result of comparison
          */
-        public int compareTo(ObjectTimestampPair other) {
+        public int compareTo(ObjectTimestampPair<T> other) {
             final long tstampdiff = this.tstamp - other.tstamp;
             if (tstampdiff == 0) {
                 // make sure the natural ordering is consistent with equals
@@ -2338,7 +2339,7 @@ public class GenericKeyedObjectPool exte
         /**
          * @return the value
          */
-        public Object getValue() {
+        public T getValue() {
             return value;
         }
 
@@ -2449,16 +2450,16 @@ public class GenericKeyedObjectPool exte
      * 
      * @since 1.5
      */
-    private static final class Latch {
+    private final class Latch<LK, LV> {
         
         /** key of associated pool */
-        private final Object _key;
+        private final LK _key;
         
         /** keyed pool associated with this latch */
         private ObjectQueue _pool;
         
         /** holds an ObjectTimestampPair when this latch has been allocated an instance */
-        private ObjectTimestampPair _pair;
+        private ObjectTimestampPair<LV> _pair;
         
         /** indicates that this latch can create an instance */
         private boolean _mayCreate = false;
@@ -2467,7 +2468,7 @@ public class GenericKeyedObjectPool exte
          * Create a latch with the given key
          * @param key key of the pool associated with this latch
          */
-        private Latch(Object key) {
+        private Latch(LK key) {
             _key = key;
         }
 
@@ -2475,7 +2476,7 @@ public class GenericKeyedObjectPool exte
          * Retuns the key of the associated pool
          * @return associated pool key
          */
-        private synchronized Object getkey() {
+        private synchronized LK getkey() {
             return _key;
         }
 
@@ -2500,7 +2501,7 @@ public class GenericKeyedObjectPool exte
          * Returns null if this latch does not have an instance allocated to it. 
          * @return the associated ObjectTimestampPair
          */
-        private synchronized ObjectTimestampPair getPair() {
+        private synchronized ObjectTimestampPair<LV> getPair() {
             return _pair;
         }
         
@@ -2508,7 +2509,7 @@ public class GenericKeyedObjectPool exte
          * Allocate an ObjectTimestampPair to this latch.
          * @param pair ObjectTimestampPair on this latch
          */
-        private synchronized void setPair(ObjectTimestampPair pair) {
+        private synchronized void setPair(ObjectTimestampPair<LV> pair) {
             _pair = pair;
         }
 
@@ -2679,7 +2680,7 @@ public class GenericKeyedObjectPool exte
     private long _minEvictableIdleTimeMillis = DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
 
     /** My hash of pools (ObjectQueue). */
-    private Map _poolMap = null;
+    private Map<K, ObjectQueue> _poolMap = null;
 
     /** The total number of active instances. */
     private int _totalActive = 0;
@@ -2695,7 +2696,7 @@ public class GenericKeyedObjectPool exte
     private int _totalInternalProcessing = 0;
 
     /** My {@link KeyedPoolableObjectFactory}. */
-    private KeyedPoolableObjectFactory _factory = null;
+    private KeyedPoolableObjectFactory<K, V> _factory = null;
 
     /**
      * My idle object eviction {@link TimerTask}, if any.
@@ -2706,13 +2707,13 @@ public class GenericKeyedObjectPool exte
      * A cursorable list of my pools.
      * @see GenericKeyedObjectPool.Evictor#run
      */
-    private CursorableLinkedList _poolList = null;
+    private CursorableLinkedList<K> _poolList = null;
 
     /** Eviction cursor (over instances within-key) */
-    private CursorableLinkedList.Cursor _evictionCursor = null;
+    private CursorableLinkedList<ObjectTimestampPair<V>>.Cursor _evictionCursor = null;
     
     /** Eviction cursor (over keys) */
-    private CursorableLinkedList.Cursor _evictionKeyCursor = null;
+    private CursorableLinkedList<K>.Cursor _evictionKeyCursor = null;
 
     /** Whether or not the pools behave as LIFO queues (last in first out) */
     private boolean _lifo = DEFAULT_LIFO;
@@ -2722,6 +2723,6 @@ public class GenericKeyedObjectPool exte
      * that objects can be allocated in the order in which the threads requested
      * them.
      */
-    private LinkedList _allocationQueue = new LinkedList();
+    private LinkedList<Latch<K, V>> _allocationQueue = new LinkedList<Latch<K, V>>();
 
 }



Mime
View raw message