Author: toad
Date: 2007-07-18 18:12:56 +0000 (Wed, 18 Jul 2007)
New Revision: 14176

Modified:
   trunk/freenet/src/freenet/support/LRUQueue.java
Log:
throw an error if they are not the same size

Modified: trunk/freenet/src/freenet/support/LRUQueue.java
===================================================================
--- trunk/freenet/src/freenet/support/LRUQueue.java     2007-07-18 18:11:47 UTC 
(rev 14175)
+++ trunk/freenet/src/freenet/support/LRUQueue.java     2007-07-18 18:12:56 UTC 
(rev 14176)
@@ -128,6 +128,9 @@
         */
        public synchronized Object[] toArrayOrdered(Object[] array) {
                array = toArray(array);
+               int listSize = list.size();
+               if(array.length != listSize)
+                       throw new 
IllegalStateException("array.length="+array.length+" but list.size="+listSize);
                int x = 0;
                for(Enumeration e = 
list.reverseElements();e.hasMoreElements();) {
                        array[x++] = e.nextElement();


Reply via email to