diff options
author | Stefan Xenos | 2016-10-26 07:35:02 +0000 |
---|---|---|
committer | Stefan Xenos | 2016-10-26 07:35:02 +0000 |
commit | f470ac39f9850055bae81b4d8b3bd59ecf0b674e (patch) | |
tree | fa5fbf3e901019ce8888bf07a337413b9273c98e | |
parent | 7f7e4ff458048c047ff0ee36304cbf7eaf4d1d4c (diff) | |
download | rt.equinox.bundles-f470ac39f9850055bae81b4d8b3bd59ecf0b674e.tar.gz rt.equinox.bundles-f470ac39f9850055bae81b4d8b3bd59ecf0b674e.tar.xz rt.equinox.bundles-f470ac39f9850055bae81b4d8b3bd59ecf0b674e.zip |
Bug 506447 - testAutoCancelDoesNothingForTrivialConversions fails on allI20161027-0200I20161026-2000
platforms
Revert an incorrect simplification in SubMonitor.newChild that was
causing test failures.
Change-Id: I865775bee006e29e60e71a66a47189b42e8b7433
Signed-off-by: Stefan Xenos <sxenos@gmail.com>
-rw-r--r-- | bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java index 1cf2d9d75..66e037565 100644 --- a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java +++ b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java @@ -985,14 +985,20 @@ public final class SubMonitor implements IProgressMonitorWithBlocking { * @since 3.8 */ public SubMonitor split(int totalWork, int suppressFlags) throws OperationCanceledException { + int oldUsedForParent = this.usedForParent; SubMonitor result = newChild(totalWork, suppressFlags); - if ((flags & SUPPRESS_ISCANCELED) == 0 && result != this) { + if ((flags & SUPPRESS_ISCANCELED) == 0) { int ticksTheChildWillReportToParent = result.totalParent; // If the new child reports a nonzero amount of progress. if (ticksTheChildWillReportToParent > 0) { - root.checkForCancellation(); + // Don't check for cancellation if the child is consuming 100% of its parent since whatever code created + // the parent already performed this check. + if (oldUsedForParent > 0 || usedForParent < totalParent) { + // Treat this as a nontrivial operation and check for cancellation unconditionally. + root.checkForCancellation(); + } } else { root.reportTrivialOperation(TRIVIAL_SPLIT_DELTA); } |