You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2007/10/07 07:10:33 UTC
svn commit: r582575 -
/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java
Author: rajdavies
Date: Sat Oct 6 22:10:28 2007
New Revision: 582575
URL: http://svn.apache.org/viewvc?rev=582575&view=rev
Log:
refresh entry for prev as well as next
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java?rev=582575&r1=582574&r2=582575&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java Sat Oct 6 22:10:28 2007
@@ -257,45 +257,50 @@
* @return next entry
*/
public synchronized IndexItem getNextEntry(IndexItem current) {
- IndexItem result = null;
- if (current != null ) {
- current = (IndexItem) refreshEntry(current);
- if(current.getNextItem() >= 0){
- try {
- result = indexManager.getIndex(current.getNextItem());
- } catch (IOException e) {
- throw new RuntimeException("Failed to get next index from " + indexManager + " for " + current, e);
- }
- }
- }
- // essential last get's updated consistently
- if (result != null && last != null && last.equals(result)) {
- result = last;
- }
- return result;
- }
+ IndexItem result = null;
+ if (current != null) {
+ current = (IndexItem) refreshEntry(current);
+ if (current.getNextItem() >= 0) {
+ try {
+ result = indexManager.getIndex(current.getNextItem());
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to get next index from "
+ + indexManager + " for " + current, e);
+ }
+ }
+ }
+ // essential last get's updated consistently
+ if (result != null && last != null && last.equals(result)) {
+ result = last;
+ }
+ return result;
+ }
/**
- * Retrive the prev entry after this entry
- *
- * @param entry
- * @return prev entry
- */
+ * Retrive the prev entry after this entry
+ *
+ * @param entry
+ * @return prev entry
+ */
public synchronized IndexItem getPrevEntry(IndexItem current) {
- IndexItem result = null;
- if (current != null && current.getPreviousItem() >= 0) {
- try {
- result = indexManager.getIndex(current.getPreviousItem());
- } catch (IOException e) {
- throw new RuntimeException("Failed to get current index for " + current, e);
- }
- }
- // essential root get's updated consistently
- if (result != null && root != null && root.equals(result)) {
- return root;
- }
- return result;
- }
+ IndexItem result = null;
+ if (current != null) {
+ if (current.getPreviousItem() >= 0) {
+ current = (IndexItem) refreshEntry(current);
+ try {
+ result = indexManager.getIndex(current.getPreviousItem());
+ } catch (IOException e) {
+ throw new RuntimeException(
+ "Failed to get current index for " + current, e);
+ }
+ }
+ }
+ // essential root get's updated consistently
+ if (result != null && root != null && root.equals(result)) {
+ return root;
+ }
+ return result;
+ }
public synchronized StoreEntry getEntry(StoreEntry current) {
StoreEntry result = null;