diff --git a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/GroupByValueQuery.java b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/GroupByValueQuery.java index e340314fe..efb08eb4a 100644 --- a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/GroupByValueQuery.java +++ b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/GroupByValueQuery.java @@ -41,8 +41,6 @@ public class GroupByValueQuery implements IQuery public IResult execute(IProgressListener listener) throws Exception { - listener.subTask(Messages.GroupByValueQuery_GroupingObjects); - Quantize quantize = Quantize.valueDistribution(Messages.GroupByValueQuery_Column_StringValue) // .column(Messages.GroupByValueQuery_Column_Objects, Quantize.COUNT) // .column(Messages.Column_ShallowHeap, Quantize.SUM_LONG, SortDirection.DESC) // @@ -50,6 +48,14 @@ public IResult execute(IProgressListener listener) throws Exception .addDerivedData(RetainedSizeDerivedData.APPROXIMATE) // .build(); + int totalWork = 0; + for (int[] objectIds : objects) + { + totalWork += objectIds.length; + } + + listener.beginTask(Messages.GroupByValueQuery_GroupingObjects, totalWork); + boolean canceled = false; for (int[] objectIds : objects) { @@ -72,11 +78,15 @@ public IResult execute(IProgressListener listener) throws Exception subject = ((IObject) subject).getClassSpecificName(); quantize.addValue(objectId, subject, null, object.getUsedHeapSize(), object.getRetainedHeapSize()); + + listener.worked(1); } if (canceled) break; } + listener.done(); + return quantize.getResult(); } }