Fix bug in remove method from coverage testing

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131442 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2003-12-14 16:10:38 +00:00
parent 344f977b63
commit d9883f168e
1 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/StaticBucketMap.java,v 1.14 2003/12/06 13:03:15 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/StaticBucketMap.java,v 1.15 2003/12/14 16:10:38 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -131,7 +131,7 @@ import java.util.Set;
*
* @deprecated Moved to map subpackage. Due to be removed in v4.0.
* @since Commons Collections 2.1
* @version $Revision: 1.14 $ $Date: 2003/12/06 13:03:15 $
* @version $Revision: 1.15 $ $Date: 2003/12/14 16:10:38 $
*
* @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
* @author <a href="mailto:g-froehlich@gmx.de">Gerhard Froehlich</a>
@ -625,8 +625,11 @@ public final class StaticBucketMap implements Map {
return false;
}
public boolean remove(Object o) {
Map.Entry entry = (Map.Entry)o;
public boolean remove(Object obj) {
if (obj instanceof Map.Entry == false) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
int hash = getHash(entry.getKey());
synchronized (m_locks[hash]) {
for (Node n = m_buckets[hash]; n != null; n = n.next) {