Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oberlies2012-10-09 05:33:38 -0400
committerTobias Oberlies2012-10-09 05:34:57 -0400
commit17a359869cee9cba2dfc19fcae795903cba73029 (patch)
tree2e2d480bb045e77a7609bdc7e80c2e6aab33e765 /bundles/org.eclipse.equinox.p2.artifact.repository
parent6dae919c7be7aae193acb194a82bfe8c7d586446 (diff)
downloadrt.equinox.p2-17a359869cee9cba2dfc19fcae795903cba73029.tar.gz
rt.equinox.p2-17a359869cee9cba2dfc19fcae795903cba73029.tar.xz
rt.equinox.p2-17a359869cee9cba2dfc19fcae795903cba73029.zip
391400 Include repository URL in status if getArtifacts fails
Bug: 391400 Status returned by getArtifacts does not include repository URL of problematic repository in case of an error
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties3
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java10
4 files changed, 15 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
index 4a126c046..2a8701242 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
@@ -334,7 +334,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) {
SubMonitor subMonitor = SubMonitor.convert(monitor, requests.length);
- MultiStatus multiStatus = new MultiStatus(Activator.ID, IStatus.OK, Messages.message_childrenRepos, null);
+ MultiStatus multiStatus = new MultiStatus(Activator.ID, IStatus.OK, Messages.message_artifactsFromChildRepos, null);
for (ChildInfo childInfo : loadedRepos) {
if (requests.length == 0)
break;
@@ -347,7 +347,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
requests = filterUnfetched(requests);
subMonitor.setWorkRemaining(requests.length);
- if (monitor.isCanceled())
+ if (subMonitor.isCanceled())
return Status.CANCEL_STATUS;
}
return multiStatus;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
index eae97fc3a..4588cec90 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
@@ -40,7 +40,9 @@ public class Messages extends NLS {
public static String sar_reportStatus;
public static String mirror_alreadyExists;
- public static String message_childrenRepos;
+ public static String message_artifactsFromChildRepos;
+ public static String message_problemReadingArtifact;
+
public static String exception_comparatorNotFound;
public static String exception_noComparators;
public static String exception_unsupportedAddToComposite;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
index 68453f70a..33689fcb8 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
@@ -37,7 +37,8 @@ sar_reportStatus=Problems downloading artifact: {0}.
mirror_alreadyExists=Artifact: {0} already exists in repository: {1}.
-message_childrenRepos = Messages while trying children repositories.
+message_artifactsFromChildRepos=Messages while reading artifacts from child repositories
+message_problemReadingArtifact=Problems while reading artifacts from {0}
exception_comparatorNotFound = The Artifact Comparator {0} was not found.
exception_noComparators = No Artifact Comparators are available.
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
index f72ae6847..0953cdea9 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
@@ -765,7 +765,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
- final MultiStatus overallStatus = new MultiStatus(Activator.ID, IStatus.OK, null, null);
+ final MultiStatus overallStatus = new MultiStatus(Activator.ID, IStatus.OK, NLS.bind(Messages.message_problemReadingArtifact, getLocation()), null);
LinkedList<IArtifactRequest> requestsPending = new LinkedList<IArtifactRequest>(Arrays.asList(requests));
int numberOfJobs = Math.min(requests.length, getMaximumThreads());
@@ -802,7 +802,13 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
monitor.done();
}
}
- return (monitor.isCanceled() ? Status.CANCEL_STATUS : overallStatus);
+
+ if (monitor.isCanceled())
+ return Status.CANCEL_STATUS;
+ else if (overallStatus.isOK())
+ return Status.OK_STATUS;
+ else
+ return overallStatus;
}
public synchronized IArtifactDescriptor getCompleteArtifactDescriptor(IArtifactKey key) {

Back to the top