You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2003/12/14 17:10:38 UTC

cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections StaticBucketMap.java

scolebourne    2003/12/14 08:10:38

  Modified:    collections/src/java/org/apache/commons/collections
                        StaticBucketMap.java
  Log:
  Fix bug in remove method from coverage testing
  
  Revision  Changes    Path
  1.15      +7 -4      jakarta-commons/collections/src/java/org/apache/commons/collections/StaticBucketMap.java
  
  Index: StaticBucketMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/StaticBucketMap.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- StaticBucketMap.java	6 Dec 2003 13:03:15 -0000	1.14
  +++ StaticBucketMap.java	14 Dec 2003 16:10:38 -0000	1.15
  @@ -625,8 +625,11 @@
               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) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org