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.xml2
-rw-r--r--bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/IProgressMonitor.java29
3 files changed, 30 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 fb17d96df..046bb34e8 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.13.0.qualifier
+Bundle-Version: 3.14.0.qualifier
Bundle-Localization: plugin
Export-Package: org.eclipse.core.internal.boot;x-friends:="org.eclipse.core.resources,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 ed82784de..e21dcb603 100644
--- a/bundles/org.eclipse.equinox.common/pom.xml
+++ b/bundles/org.eclipse.equinox.common/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
- <version>3.13.0-SNAPSHOT</version>
+ <version>3.14.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 04562e6cd..3eb19cb98 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
@@ -10,7 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Christoph Läubrich - join with IProgressMonitorWithBlocking
+ * Christoph Laeubrich - join with IProgressMonitorWithBlocking, add null aware helper methods
*******************************************************************************/
package org.eclipse.core.runtime;
@@ -207,4 +207,31 @@ public interface IProgressMonitor {
public default void clearBlocked() {
//default implementation does nothing
}
+
+ /**
+ * Calls {@link #done()} on the given monitor if is non-null. If the given monitor is null,
+ * this is a no-op.
+ * @param monitor the monitor to make done, might be <code>null</code>
+ * @since 3.14
+ */
+ static void done(IProgressMonitor monitor) {
+ if (monitor != null) {
+ monitor.done();
+ }
+ }
+
+ /**
+ * Returns a <code>null</code> safe access to the given monitor, for example in cases where a monitor is passed to
+ * a function the implementation can call this method to get a guaranteed non-null monitor reference
+ * @param monitor
+ * the monitor to check
+ * @return the passed monitor instance or {@link NullProgressMonitor} if monitor was <code>null</code>
+ * @since 3.14
+ */
+ static IProgressMonitor nullSafe(IProgressMonitor monitor) {
+ if (monitor == null) {
+ return new NullProgressMonitor();
+ }
+ return monitor;
+ }
}

Back to the top