aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-07-11 09:36:28 -0400
committerAlexander Kurtakov2018-07-11 09:36:28 -0400
commit5b8f70cc034458202a9feb740a398aa7deb9860a (patch)
tree380a89f8d8268c6ba6e9281e6635fe31d046091d
parentac21f7c9e03af8f31df9a3682264a61ad560b719 (diff)
downloadeclipse.platform.runtime-5b8f70cc034458202a9feb740a398aa7deb9860a.zip
eclipse.platform.runtime-5b8f70cc034458202a9feb740a398aa7deb9860a.tar.gz
eclipse.platform.runtime-5b8f70cc034458202a9feb740a398aa7deb9860a.tar.xz
Use generic getServiceReference method in BundleTestingHelper.
Change-Id: Iee6f0f0ed0ddc9b4bc6a725bd008b35bfaf30284 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/BundleTestingHelper.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/BundleTestingHelper.java b/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/BundleTestingHelper.java
index 2f54c7f..c2e6693 100644
--- a/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/BundleTestingHelper.java
+++ b/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/BundleTestingHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2016 IBM Corporation and others.
+ * Copyright (c) 2004, 2018 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
@@ -26,11 +26,11 @@ import org.osgi.service.packageadmin.PackageAdmin;
public class BundleTestingHelper {
public static Bundle[] getBundles(BundleContext context, String symbolicName, String version) {
- ServiceReference<?> packageAdminReference = context.getServiceReference(PackageAdmin.class.getName());
+ ServiceReference<PackageAdmin> packageAdminReference = context.getServiceReference(PackageAdmin.class);
if (packageAdminReference == null) {
throw new IllegalStateException("No package admin service found");
}
- PackageAdmin packageAdmin = (PackageAdmin) context.getService(packageAdminReference);
+ PackageAdmin packageAdmin = context.getService(packageAdminReference);
Bundle[] result = packageAdmin.getBundles(symbolicName, version);
context.ungetService(packageAdminReference);
return result;