commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1022234 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java
Date Wed, 13 Oct 2010 18:48:01 GMT
Author: sebb
Date: Wed Oct 13 18:48:00 2010
New Revision: 1022234

URL: http://svn.apache.org/viewvc?rev=1022234&view=rev
Log:
Document generic warning; fix incorrect type letter

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java?rev=1022234&r1=1022233&r2=1022234&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java
Wed Oct 13 18:48:00 2010
@@ -928,6 +928,7 @@ class CursorableLinkedList<E> implements
         }
     }
 
+    @SuppressWarnings("unchecked") // OK, see (1)
     private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
         in.defaultReadObject();
         _size = 0;
@@ -936,7 +937,7 @@ class CursorableLinkedList<E> implements
         _head = new Listable(null,null,null);
         int size = in.readInt();
         for (int i=0;i<size;i++) {
-            this.add((E) in.readObject());
+            this.add((E) in.readObject()); // (1) could cause class cast, but only for corrupt
input
         }
     }
 
@@ -1285,7 +1286,7 @@ class CursorableSubList<E> extends Curso
     }
 
     @Override
-    public <E> E[] toArray(E a[]) {
+    public <T> T[] toArray(T a[]) {
         checkForComod();
         return super.toArray(a);
     }



Mime
View raw message