Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.common/pom.xml4
-rw-r--r--bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/IProgressMonitor.java21
-rw-r--r--bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java1
4 files changed, 25 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF
index 09df9e63d..03ecad8e7 100644
--- a/bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.common/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.common; singleton:=true
-Bundle-Version: 3.10.100.qualifier
+Bundle-Version: 3.11.0.qualifier
Bundle-Localization: plugin
Export-Package: org.eclipse.core.internal.boot;x-friends:="org.eclipse.core.resources,org.eclipse.core.runtime.compatibility,org.eclipse.pde.build",
org.eclipse.core.internal.runtime;common=split;mandatory:=common;
diff --git a/bundles/org.eclipse.equinox.common/pom.xml b/bundles/org.eclipse.equinox.common/pom.xml
index a94af2d1c..438382ba8 100644
--- a/bundles/org.eclipse.equinox.common/pom.xml
+++ b/bundles/org.eclipse.equinox.common/pom.xml
@@ -5,7 +5,7 @@
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php
-
+
Contributors:
Igor Fedorenko - initial implementation
-->
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
- <version>3.10.100-SNAPSHOT</version>
+ <version>3.11.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/IProgressMonitor.java b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/IProgressMonitor.java
index 89ade7535..9a8960792 100644
--- a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/IProgressMonitor.java
+++ b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/IProgressMonitor.java
@@ -133,6 +133,27 @@ public interface IProgressMonitor {
public boolean isCanceled();
/**
+ * Checks whether cancellation of this monitor has been requested and throws
+ * an {@link OperationCanceledException} if it was the case.
+ * <p>
+ * This method is a shorthand for:
+ * <pre>
+ * if (monitor.isCanceled())
+ * throw new OperationCanceledException();
+ * </pre>
+ * </p>
+ *
+ * @return this monitor instance for convenience (eg., chaining)
+ * @throws OperationCanceledException if {@link #isCanceled()} returns <code>true</code>
+ * @since 3.11
+ */
+ default IProgressMonitor checkCanceled() throws OperationCanceledException {
+ if (isCanceled())
+ throw new OperationCanceledException();
+ return this;
+ }
+
+ /**
* Sets the cancel state to the given value.
*
* @param value <code>true</code> indicates that cancelation has
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 5b72ed2a1..4dbd19d8e 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
@@ -599,6 +599,7 @@ public final class SubMonitor implements IProgressMonitorWithBlocking {
* @see #isCanceled()
* @since 3.9
*/
+ @Override
public SubMonitor checkCanceled() throws OperationCanceledException {
if (isCanceled()) {
throw new OperationCanceledException();

Back to the top