diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java index e9fb81345..6dcc38b59 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java +++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 compeople AG and others. + * Copyright (c) 2007, 2018 compeople AG and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,12 +23,15 @@ import org.eclipse.equinox.p2.repository.artifact.*; /** * The <code>AbstractDeltaPatchStep</code> is an abstract processing step that * retrieves a local artifact repository containing the serialized/encoded - * artifact key. It assumes that the artifact key is stored within the data property - * of the processing step descriptor encoding the artifact key of the base artifact. + * artifact key. It assumes that the artifact key is stored within the data + * property of the processing step descriptor encoding the artifact key of the + * base artifact. */ public abstract class AbstractDeltaProcessorStep extends AbstractDeltaStep { - public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { + @Override + public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, + IArtifactDescriptor context) { super.initialize(agent, descriptor, context); if (!getStatus().isOK()) return; @@ -41,22 +44,23 @@ public abstract class AbstractDeltaProcessorStep extends AbstractDeltaStep { private void fetchLocalArtifactRepository(IProvisioningAgent agent) { if (repository != null) return; - IArtifactRepositoryManager repoMgr = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME); + IArtifactRepositoryManager repoMgr = (IArtifactRepositoryManager) agent + .getService(IArtifactRepositoryManager.SERVICE_NAME); if (repoMgr == null) { setStatus(new Status(IStatus.ERROR, Activator.ID, "Could not get artifact repository manager.")); return; } URI[] repositories = repoMgr.getKnownRepositories(IRepositoryManager.REPOSITORIES_LOCAL); - for (int i = 0; i < repositories.length; i++) { + for (URI repositorie : repositories) { try { - IArtifactRepository currentRepo = repoMgr.loadRepository(repositories[i], null); + IArtifactRepository currentRepo = repoMgr.loadRepository(repositorie, null); if (currentRepo.contains(key)) { repository = currentRepo; return; } } catch (ProvisionException e) { - //just skip unreadable repositories + // just skip unreadable repositories } } setStatus(new Status(IStatus.ERROR, Activator.ID, "No repository available containing key " + key)); |