Comment #1 on issue 164 by heue...@gmail.com: PNode#moveToFront change to avoid java.util.ConcurrentModificationException
http://code.google.com/p/piccolo2d/issues/detail?id=164

I vote to mark this as WontFix.

The method is throwing ConcurrentModificationException because that's what is
happening, you are trying to modify the list as you are iterating over it.

The javadoc for PNode.getChildrenReference() reads "This list should not be modified."

http://www.piccolo2d.org/doc/piccolo2d.java/release-1.2.1/apidocs/edu/umd/cs/piccolo/PNode.html#getChildrenReference%28%29

A workaround would be to copy the children list into a new ArrayList

List children = new ArrayList(node.getChildrenReference());
for (Iterator iterator = children.iterator(); iterator.hasNext(); )
{
  PNode child = (PNode) iterator.next();
  child.moveToFront();
}

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

Reply via email to