Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-03-08 11:21:21 -0500
committerAlexander Kurtakov2018-03-08 11:21:21 -0500
commita7a2594b6953405b4b0ba1bdf1133a13bc90f0aa (patch)
treeaacce4c48d023e4f177ecc659c59462f751c3022 /org.eclipse.m2e.core
parent16e36aee8186939d9e9891e47dbe46ff135b47d6 (diff)
downloadm2e-core-a7a2594b6953405b4b0ba1bdf1133a13bc90f0aa.tar.gz
m2e-core-a7a2594b6953405b4b0ba1bdf1133a13bc90f0aa.tar.xz
m2e-core-a7a2594b6953405b4b0ba1bdf1133a13bc90f0aa.zip
Use the generic getServiceReference method.
Change-Id: I925379bd276e5f3b629ab13c26b9a8852f166fdb Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.m2e.core')
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MarkerUtils.java10
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java6
2 files changed, 8 insertions, 8 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MarkerUtils.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MarkerUtils.java
index d11f97b6..09d60d67 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MarkerUtils.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MarkerUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010-2013 Sonatype, Inc. and others
+ * Copyright (c) 2010-2018 Sonatype, 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
@@ -37,12 +37,12 @@ public class MarkerUtils {
public static void decorateMarker(IMarker marker) {
BundleContext context = MavenPluginActivator.getDefault().getBundleContext();
- ServiceReference ref = context.getServiceReference(IMarkerLocationService.class.getName());
+ ServiceReference<IMarkerLocationService> ref = context.getServiceReference(IMarkerLocationService.class);
if(ref == null) {
log.warn("Could not find OSGI service for " + IMarkerLocationService.class.getName());
return;
}
- IMarkerLocationService service = (IMarkerLocationService) context.getService(ref);
+ IMarkerLocationService service = context.getService(ref);
if(service != null) {
try {
service.findLocationForMarker(marker);
@@ -55,12 +55,12 @@ public class MarkerUtils {
public static void addEditorHintMarkers(IMavenMarkerManager markerManager, IFile pom, MavenProject mavenProject,
String type) {
BundleContext context = MavenPluginActivator.getDefault().getBundleContext();
- ServiceReference ref = context.getServiceReference(IEditorMarkerService.class.getName());
+ ServiceReference<IEditorMarkerService> ref = context.getServiceReference(IEditorMarkerService.class);
if(ref == null) {
log.warn("Could not find OSGI service for " + IEditorMarkerService.class.getName());
return;
}
- IEditorMarkerService service = (IEditorMarkerService) context.getService(ref);
+ IEditorMarkerService service = context.getService(ref);
if(service != null) {
try {
service.addEditorHintMarkers(markerManager, pom, mavenProject, type);
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java
index 214a0ec9..50c2ac00 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2018 Sonatype, 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
@@ -111,8 +111,8 @@ public class ProjectRegistryReader {
// TODO inject dependencies already!
if(packageAdmin == null) {
BundleContext context = MavenPluginActivator.getDefault().getBundleContext();
- ServiceReference serviceReference = context.getServiceReference(PackageAdmin.class.getName());
- packageAdmin = (PackageAdmin) context.getService(serviceReference);
+ ServiceReference<PackageAdmin> serviceReference = context.getServiceReference(PackageAdmin.class);
+ packageAdmin = context.getService(serviceReference);
}
return packageAdmin;
}

Back to the top