Author: Grid.Qian
Date: 2009-07-01 05:50:30 -0400 (Wed, 01 Jul 2009)
New Revision: 16313
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/CollapsableEditPart.java
Log:
JBIDE-4539: when collapse a element, there is java.util.ConcurrentModificationException
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/CollapsableEditPart.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/CollapsableEditPart.java 2009-07-01
08:19:58 UTC (rev 16312)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/CollapsableEditPart.java 2009-07-01
09:50:30 UTC (rev 16313)
@@ -246,17 +246,40 @@
// figures
refreshChildren();
- // Manually remove the rest of the children
+
+ // changed by Grid.Qian
+ // when use figure.remove() to remove the children element
+ // we will change the list of figure.getChildren()
+ // so we will get the a error.
+ int size = figure.getChildren().size();
+ for(int i = 0; i < size; i++){
+ figure.remove((IFigure)figure.getChildren().get(0));
+ }
+
+ /*// Manually remove the rest of the children
for (Object o : figure.getChildren()) {
figure.remove((IFigure)o);
- }
+ }*/
+
+
// Now restore the collapsed children, border and layout
addCollapsedContents(figure);
} else {
- // Manually remove the children
+
+ // changed by Grid.Qian
+ // when use figure.remove() to remove the children element
+ // we will change the list of figure.getChildren()
+ // so we will get the a error.
+ int size = figure.getChildren().size();
+ for(int i = 0; i < size; i++){
+ figure.remove((IFigure)figure.getChildren().get(0));
+ }
+
+ /*// Manually remove the children
for (Object o : figure.getChildren()) {
figure.remove((IFigure)o);
- }
+ }*/
+
// Now restore the expanded children, border and layout
configureExpandedFigure(figure);
refreshChildren();