commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38565] - [collections] java.lang.ArrayIndexOutOfBoundsException
Date Wed, 08 Feb 2006 14:31:05 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38565>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38565





------- Additional Comments From stijn.christiaens@vub.ac.be  2006-02-08 15:31 -------
This is the code that caused the bug. The variable breadCrumbs is a
BoundedFifoBuffer, but we use the Collection interface.
The target is to run over the buffer. If we encounter an element equal to the
one we have, all next elements in the buffer must be removed.
The Exception happens when the first element in the collection is the element we
have, so all the remaining ones must be removed, and only the first can stay.
The exception happens at the call of iter.remove()

		// see if this crumb is already present, because if it is
		// we must remove all later ones for a natural feel
		// breadCrumbs is a BoundedFifoBuffer, but we use the interface Collection
		boolean remove = false;
		Iterator<BreadCrumb> iter = breadCrumbs.iterator();
		while (iter.hasNext()) {
			BreadCrumb tempCrumb = iter.next();
			if (remove) {
				iter.remove();
			}
			if (crumb.equals(tempCrumb)) {
				remove = true;
			}
		}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
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