directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r385097 - /directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringStack.java
Date Sat, 11 Mar 2006 15:43:19 GMT
Author: trustin
Date: Sat Mar 11 07:43:18 2006
New Revision: 385097

URL: http://svn.apache.org/viewcvs?rev=385097&view=rev
Log:
Fixed ArrayIndexOutOfBoundsException in ExpiringStack.push()

Modified:
    directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringStack.java

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringStack.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringStack.java?rev=385097&r1=385096&r2=385097&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringStack.java (original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExpiringStack.java Sat Mar
11 07:43:18 2006
@@ -84,9 +84,12 @@
         {
             // expand queue
             final int oldLen = items.length;
-            Object[] tmp = new Object[ oldLen * 2 ];
-            System.arraycopy( items, 0, tmp, 0, size );
-            items = tmp;
+            Object[] tmpItems = new Object[ oldLen * 2 ];
+            System.arraycopy( items, 0, tmpItems, 0, size );
+            long[] tmpTimestamps = new long[ oldLen * 2 ];
+            System.arraycopy( timestamps, 0, tmpTimestamps, 0, size );
+            items = tmpItems;
+            timestamps = tmpTimestamps;
         }
 
         items[ size ] = obj;



Mime
View raw message