activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r591160 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
Date Thu, 01 Nov 2007 22:42:39 GMT
Author: rajdavies
Date: Thu Nov  1 15:42:33 2007
New Revision: 591160

URL: http://svn.apache.org/viewvc?rev=591160&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1246

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java?rev=591160&r1=591159&r2=591160&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
Thu Nov  1 15:42:33 2007
@@ -40,6 +40,7 @@
     private int binId;
     private int persistedSize;
     private List<HashEntry> hashIndexEntries;
+    private static final HashEntry nullEntry = new HashEntry();
     /*
      * for persistence only
      */
@@ -192,6 +193,11 @@
     void addHashEntry(int index, HashEntry entry) throws IOException {
         // index = index >= 0 ? index : 0;
         // index = (index == 0 || index< size()) ? index : size()-1;
+        if (index > hashIndexEntries.size()) {
+            for (int i = hashIndexEntries.size(); i < (index+1);i++) {
+                hashIndexEntries.add(nullEntry);
+            }
+        }
         hashIndexEntries.add(index, entry);
     }
 



Mime
View raw message