Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Johnson2018-10-09 05:00:18 -0400
committerAndrew Johnson2018-10-09 05:00:18 -0400
commit63107f981bc30b0841b3f33272552806d7f54df0 (patch)
treedb02ceb668040c911d531d77407af4240c55e5ff
parentf45a8cf2271c9f446d5664390365690856b58254 (diff)
downloadorg.eclipse.mat-63107f981bc30b0841b3f33272552806d7f54df0.tar.gz
org.eclipse.mat-63107f981bc30b0841b3f33272552806d7f54df0.tar.xz
org.eclipse.mat-63107f981bc30b0841b3f33272552806d7f54df0.zip
[539750] DerivedCalculator ConcurrentModificationException
Avoid problem of retained size calculation with simultaneous sort. Change-Id: I6660c96925bb143bba2cba885a3209bf3f2536e4
-rw-r--r--plugins/org.eclipse.mat.report/src/org/eclipse/mat/query/refined/RefinedStructuredResult.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/org.eclipse.mat.report/src/org/eclipse/mat/query/refined/RefinedStructuredResult.java b/plugins/org.eclipse.mat.report/src/org/eclipse/mat/query/refined/RefinedStructuredResult.java
index fe25759d..0b234d1c 100644
--- a/plugins/org.eclipse.mat.report/src/org/eclipse/mat/query/refined/RefinedStructuredResult.java
+++ b/plugins/org.eclipse.mat.report/src/org/eclipse/mat/query/refined/RefinedStructuredResult.java
@@ -462,8 +462,11 @@ public abstract class RefinedStructuredResult implements IStructuredResult, //
sm = null;
}
int index = 0;
- for (Object row : elements)
+ // Don't iterate over the elements in case the order is changed by the user sorting the table.
+ // Just index to avoid ConcurrentModificationException.
+ for (; index < elements.size(); )
{
+ Object row = elements.get(index);
if (sm != null)
l2 = sm.nextMonitor();
accessor.calculator.calculate(operation, row, l2);

Back to the top