commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <scolebou...@btopenworld.com>
Subject Re: [collections] [PATCH] AbstractMapBag.remove() bug
Date Thu, 14 Jul 2005 23:13:15 GMT
The proposed patch fixed half the problem.

Full fix and test case committed in svn r219131.

Stephen

Steve_Clark@fws.gov wrote:
> I can't get in to CVS to see if this is fixed, but there is a bug in 
> AbstractMapBag in 3.1: BagIterator.remove() does not properly remove the 
> last instance of a given item; the result is infinite looping.  Here is a 
> patch.
> 
> -steve
> 
> Steve Clark
> ECOS Development Group
> steve_clark@fws.gov
> (970)226-9291
> 
> 
> --- AbstractMapBag.java.orig    2005-07-14 11:14:33.708373173 -0600
> +++ AbstractMapBag.java 2005-07-14 11:15:30.566623793 -0600
> @@ -221,7 +221,7 @@
>                  throw new IllegalStateException();
>              }
>              MutableInteger mut = (MutableInteger) current.getValue();
> -            if (mut.value > 0) {
> +            if (mut.value > 1) {
>                  mut.value--;
>                  parent.size--;
>              } else {
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 

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


Mime
View raw message