Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-02-26 17:13:10 +0000
committerAlexander Kurtakov2015-02-26 17:13:10 +0000
commit66c9297a230aeb57eb49d07f77eebf9c68d5b9ad (patch)
tree8ef9f1148e3aed53501cfca5f613b03940007956 /bundles/org.eclipse.equinox.p2.transport.ecf
parentf92c74ac081d929a7ce96a85b26bf60b5364a101 (diff)
downloadrt.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.transport.ecf')
-rw-r--r--bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/Activator.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileInfoReader.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java5
3 files changed, 10 insertions, 9 deletions
diff --git a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/Activator.java b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/Activator.java
index 0a4d01f3c..7043074cf 100644
--- a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Cloudsmith Inc and others.
+ * Copyright (c) 2009, 2015 Cloudsmith Inc 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
@@ -9,6 +9,7 @@
* Cloudsmith Inc - initial API and implementation
* IBM Corporation - ongoing development
* Genuitec - Bug 291926
+ * Red Hat Inc. - Bug 460967
******************************************************************************/
package org.eclipse.equinox.internal.p2.transport.ecf;
@@ -146,7 +147,7 @@ public class Activator implements BundleActivator {
}
private boolean startBundle(String bundleId) {
- PackageAdmin packageAdmin = (PackageAdmin) ServiceHelper.getService(Activator.getContext(), PackageAdmin.class.getName());
+ PackageAdmin packageAdmin = ServiceHelper.getService(Activator.getContext(), PackageAdmin.class);
if (packageAdmin == null)
return false;
diff --git a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileInfoReader.java b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileInfoReader.java
index 52bfacbb8..3ec01631a 100644
--- a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileInfoReader.java
+++ b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileInfoReader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010, IBM Corporation, and others.
+ * Copyright (c) 2009, 2015, IBM Corporation, and others.
* The code, documentation and other materials contained herein have been
* licensed under the Eclipse Public License - v 1.0 by the copyright holder
* listed above, as the Initial Contributor under such license. The text of
@@ -7,6 +7,7 @@
* Contributors:
* IBM Corporation - initial implementation
* Cloudsmith Inc - modified API, and implementation
+ * Red Hat Inc. - Bug 460967
******************************************************************************/
package org.eclipse.equinox.internal.p2.transport.ecf;
@@ -22,11 +23,9 @@ import org.eclipse.ecf.filetransfer.events.IRemoteFileSystemBrowseEvent;
import org.eclipse.ecf.filetransfer.events.IRemoteFileSystemEvent;
import org.eclipse.ecf.filetransfer.identity.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
+import org.eclipse.equinox.internal.p2.repository.*;
import org.eclipse.equinox.internal.p2.repository.Activator;
-import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException;
-import org.eclipse.equinox.internal.p2.repository.JREHttpClientRequiredException;
import org.eclipse.equinox.internal.p2.repository.Messages;
-import org.eclipse.equinox.internal.p2.repository.RepositoryPreferences;
import org.eclipse.osgi.util.NLS;
/**
@@ -168,7 +167,7 @@ public class FileInfoReader extends Job implements IRemoteFileSystemListener {
throw RepositoryStatusHelper.fromMessage(Messages.ecf_configuration_error);
}
- IRemoteFileSystemBrowserContainerAdapter adapter = (IRemoteFileSystemBrowserContainerAdapter) container.getAdapter(IRemoteFileSystemBrowserContainerAdapter.class);
+ IRemoteFileSystemBrowserContainerAdapter adapter = container.getAdapter(IRemoteFileSystemBrowserContainerAdapter.class);
if (adapter == null) {
throw RepositoryStatusHelper.fromMessage(Messages.ecf_configuration_error);
}
diff --git a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java
index 0d97fecc8..dd339a06f 100644
--- a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java
+++ b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 Cloudsmith Inc.
+ * Copyright (c) 2006, 2015 Cloudsmith Inc.
* 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
@@ -10,6 +10,7 @@
* IBM Corporation - ongoing development
* Sonatype Inc - ongoing development
* Ericsson AB. - Bug 407940 - [transport] Initial connection happens in current thread
+ * Red Hat Inc. - Bug 460967
******************************************************************************/
package org.eclipse.equinox.internal.p2.transport.ecf;
@@ -221,7 +222,7 @@ public final class FileReader extends FileTransferJob implements IFileTransferLi
private synchronized void pauseIfPossible(IIncomingFileTransfer source) {
if (isPaused() && !hasPaused) {
- pasuable = (IFileTransferPausable) source.getAdapter(IFileTransferPausable.class);
+ pasuable = source.getAdapter(IFileTransferPausable.class);
if (pasuable != null)
pasuable.pause();
}

Back to the top