Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2010-03-30 18:26:28 -0400
committerIan Bull2010-03-30 18:26:28 -0400
commit3ad938e16227692213f76b5b58571cc8549eb171 (patch)
treeed632a00d3f30d7614f5a06bad2e8fc33f56bc1c /bundles/org.eclipse.equinox.p2.repository
parent8ddf94526a1ff72f60b38fabfa1932c004d2d82b (diff)
downloadrt.equinox.p2-3ad938e16227692213f76b5b58571cc8549eb171.tar.gz
rt.equinox.p2-3ad938e16227692213f76b5b58571cc8549eb171.tar.xz
rt.equinox.p2-3ad938e16227692213f76b5b58571cc8549eb171.zip
bug 305237: [repository] Handle operation cancelled exception in execute batch
https://bugs.eclipse.org/bugs/show_bug.cgi?id=305237
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java2
2 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java
index 2ae04bd70..692c66fab 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java
@@ -90,7 +90,7 @@ public abstract class AbstractArtifactRepository extends AbstractRepository<IArt
public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
return new ArtifactDescriptor(key);
}
-
+
public IArtifactKey createArtifactKey(String classifier, String id, Version version) {
return new ArtifactKey(classifier, id, version);
}
@@ -98,6 +98,8 @@ public abstract class AbstractArtifactRepository extends AbstractRepository<IArt
public IStatus executeBatch(IRunnableWithProgress runnable, IProgressMonitor monitor) {
try {
runnable.run(monitor);
+ } catch (OperationCanceledException oce) {
+ return new Status(IStatus.CANCEL, Activator.ID, oce.getMessage(), oce);
} catch (Exception e) {
return new Status(IStatus.ERROR, Activator.ID, e.getMessage(), e);
}
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java
index 2dfbca51d..b526bb874 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java
@@ -143,6 +143,8 @@ public abstract class AbstractMetadataRepository extends AbstractRepository<IIns
public IStatus executeBatch(IRunnableWithProgress runnable, IProgressMonitor monitor) {
try {
runnable.run(monitor);
+ } catch (OperationCanceledException oce) {
+ return new Status(IStatus.CANCEL, Activator.ID, oce.getMessage(), oce);
} catch (Exception e) {
return new Status(IStatus.ERROR, Activator.ID, e.getMessage(), e);
}

Back to the top