Author: peter_firmstone Date: Mon Dec 26 12:05:37 2011 New Revision: 1224722
URL: http://svn.apache.org/viewvc?rev=1224722&view=rev Log: JDK 7 fix compile errors Modified: river/jtsk/trunk/src/com/sun/jini/outrigger/FastList.java Modified: river/jtsk/trunk/src/com/sun/jini/outrigger/FastList.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/com/sun/jini/outrigger/FastList.java?rev=1224722&r1=1224721&r2=1224722&view=diff ============================================================================== --- river/jtsk/trunk/src/com/sun/jini/outrigger/FastList.java (original) +++ river/jtsk/trunk/src/com/sun/jini/outrigger/FastList.java Mon Dec 26 12:05:37 2011 @@ -96,7 +96,7 @@ class FastList<T extends FastList.Node> * @return true if this node has never previously been removed, false if * it has already been removed. */ - private synchronized boolean remove() { + synchronized boolean remove() { if (removed) { return false; } @@ -105,7 +105,7 @@ class FastList<T extends FastList.Node> } synchronized void markOnList(FastList<?> list) { - this.list = list; + setList(list); } /** @@ -117,6 +117,34 @@ class FastList<T extends FastList.Node> public boolean removed() { return removed; } + + /** + * @return the index + */ + long getIndex() { + return index; + } + + /** + * @param index the index to set + */ + void setIndex(long index) { + this.index = index; + } + + /** + * @return the list + */ + FastList<?> getList() { + return list; + } + + /** + * @param list the list to set + */ + void setList(FastList<?> list) { + this.list = list; + } } private class FastListIteratorImpl implements Iterator<T> { @@ -171,7 +199,7 @@ class FastList<T extends FastList.Node> T result = null; while (baseIterator.hasNext()) { T node = baseIterator.next(); - if (node.index >= index) { + if (node.getIndex() >= index) { /* Finished, no appropriate nodes.*/ break; } @@ -213,14 +241,14 @@ class FastList<T extends FastList.Node> */ public void add(T node) { synchronized (node) { - if (node.list == null) { - node.list = this; + if (node.getList() == null) { + node.setList(this); } else { throw new IllegalArgumentException("Attempt to reuse node " + node); } } - node.index = nextIndex.getAndIncrement(); + node.setIndex(nextIndex.getAndIncrement()); baseQueue.add(node); } @@ -235,7 +263,7 @@ class FastList<T extends FastList.Node> */ public boolean remove(T node) { synchronized (node) { - if (node.list != this) { + if (node.getList() != this) { throw new IllegalArgumentException( "Cannot remove a node from a list it is not on"); } @@ -252,7 +280,7 @@ class FastList<T extends FastList.Node> Iterator<T> it = baseQueue.iterator(); while (it.hasNext()) { T node = it.next(); - if (node.index >= stopIndex) { + if (node.getIndex() >= stopIndex) { // Done enough return; }
