scolebourne 2003/12/01 16:37:11
Modified: collections/src/java/org/apache/commons/collections/map
HashedMap.java
Log:
Fix method scopes
Fix bug in HashEntry
Revision Changes Path
1.3 +8 -10
jakarta-commons/collections/src/java/org/apache/commons/collections/map/HashedMap.java
Index: HashedMap.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/HashedMap.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HashedMap.java 1 Dec 2003 22:48:59 -0000 1.2
+++ HashedMap.java 2 Dec 2003 00:37:11 -0000 1.3
@@ -586,9 +586,7 @@
if (current == null) {
throw new IllegalStateException("Iterator remove() can only be
called once after next()");
}
- Object old = current.getValue();
- current.setValue(value);
- return old;
+ return current.setValue(value);
}
}
@@ -834,7 +832,7 @@
protected Object key;
protected Object value;
- HashEntry(HashEntry next, int hashCode, Object key, Object value) {
+ protected HashEntry(HashEntry next, int hashCode, Object key, Object value)
{
super();
this.next = next;
this.hashCode = hashCode;
@@ -848,7 +846,7 @@
return value;
}
public Object setValue(Object value) {
- Object old = value;
+ Object old = this.value;
this.value = value;
return old;
}
@@ -883,7 +881,7 @@
private HashEntry next;
private int expectedModCount;
- HashIterator(HashedMap map) {
+ protected HashIterator(HashedMap map) {
super();
this.map = map;
HashEntry[] data = map.data;
@@ -901,7 +899,7 @@
return (next != null);
}
- HashEntry nextEntry() {
+ protected HashEntry nextEntry() {
if (map.modCount != expectedModCount) {
throw new ConcurrentModificationException();
}
@@ -921,7 +919,7 @@
return newCurrent;
}
- public HashEntry currentEntry() {
+ protected HashEntry currentEntry() {
return current;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]