diff options
author | Alexander Kurtakov | 2015-02-26 17:13:10 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2015-02-26 17:13:10 +0000 |
commit | 66c9297a230aeb57eb49d07f77eebf9c68d5b9ad (patch) | |
tree | 8ef9f1148e3aed53501cfca5f613b03940007956 /bundles/org.eclipse.equinox.p2.artifact.repository/src | |
parent | f92c74ac081d929a7ce96a85b26bf60b5364a101 (diff) | |
download | rt.equinox.p2-66c9297a230aeb57eb49d07f77eebf9c68d5b9ad.tar.gz rt.equinox.p2-66c9297a230aeb57eb49d07f77eebf9c68d5b9ad.tar.xz rt.equinox.p2-66c9297a230aeb57eb49d07f77eebf9c68d5b9ad.zip |
Bug 460967 - Use type safe service retrievingI20150303-0800
Instead of retrieving services based on their String class name there is
newer implementation that takes the class directly and returns the
correct class preventing casts.
Change-Id: I8b26f4d294b927f4c28a6ba4e68e35bd401df4ec
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository/src')
2 files changed, 6 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java index f86e1f5cf..cab3263cd 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2015 IBM Corporation 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 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Red Hat Inc. - Bug 460967 *******************************************************************************/ package org.eclipse.equinox.internal.p2.artifact.repository; @@ -73,7 +74,7 @@ public class Activator implements BundleActivator { if (locationCache.containsKey(repositoryLocation)) { return locationCache.get(repositoryLocation); } - Location anyLoc = (Location) ServiceHelper.getService(Activator.getContext(), Location.class.getName()); + Location anyLoc = ServiceHelper.getService(Activator.getContext(), Location.class); File repositoryFile = URIUtil.toFile(repositoryLocation); Location location = anyLoc.createLocation(null, getLockFile(repositoryLocation).toURL(), isReadOnly(repositoryFile)); location.set(getLockFile(repositoryLocation).toURL(), false); diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java index 15cceb7b8..ee6cc083b 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2007, 2013 compeople AG and others. +* Copyright (c) 2007, 2015 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 @@ -8,6 +8,7 @@ * Contributors: * compeople AG (Stefan Liebig) - initial API and implementation * IBM - continuing development +* Red Hat Inc. - Bug 460967 *******************************************************************************/ package org.eclipse.equinox.internal.p2.artifact.repository; @@ -72,7 +73,7 @@ public class SignatureVerifier extends ProcessingStep { } private IStatus verifyContent() throws IOException { - SignedContentFactory verifierFactory = (SignedContentFactory) ServiceHelper.getService(Activator.getContext(), SignedContentFactory.class.getName()); + SignedContentFactory verifierFactory = ServiceHelper.getService(Activator.getContext(), SignedContentFactory.class); SignedContent signedContent; try { signedContent = verifierFactory.getSignedContent(inputFile); |