Skip to content

Commit

Permalink
DownloadManager - remove unnecessary done() call on ProgressMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
vogella committed Dec 3, 2024
1 parent 1a42e02 commit 71c67fa
Showing 1 changed file with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,23 @@ private void filterUnfetched() {
}

/*
* Start the downloads. Return a status message indicating success or failure of the overall operation
* Start the downloads. Return a status message indicating success or failure of
* the overall operation
*/
public IStatus start(IProgressMonitor monitor) {
SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.download_artifact, 1000);
try {
if (requestsToProcess.isEmpty())
return Status.OK_STATUS;

if (provContext == null)
provContext = new ProvisioningContext(agent);

IArtifactRepository[] repositories = getArtifactRepositories(subMonitor);
if (repositories.length == 0)
return new Status(IStatus.ERROR, EngineActivator.ID, Messages.download_no_repository, new Exception(Collect.NO_ARTIFACT_REPOSITORIES_AVAILABLE));
fetch(repositories, subMonitor.newChild(500));
return overallStatus(monitor, repositories);
} finally {
subMonitor.done();
}
if (requestsToProcess.isEmpty())
return Status.OK_STATUS;

if (provContext == null)
provContext = new ProvisioningContext(agent);

IArtifactRepository[] repositories = getArtifactRepositories(subMonitor);
if (repositories.length == 0)
return new Status(IStatus.ERROR, EngineActivator.ID, Messages.download_no_repository,
new Exception(Collect.NO_ARTIFACT_REPOSITORIES_AVAILABLE));
fetch(repositories, subMonitor.newChild(500));
return overallStatus(monitor, repositories);
}

/**
Expand Down

0 comments on commit 71c67fa

Please sign in to comment.