Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-03-14 02:39:03 -0400
committerAlexander Kurtakov2018-03-14 02:46:00 -0400
commita4f8dc7748d38e08d01103be454f48c8b50cc2f3 (patch)
treeee37cb5e728a0ff8f684595a71b1bc7903e944ed
parente671e63165d6de3bfd39c455fbf6f5600cb989eb (diff)
downloadm2e-core-a4f8dc7748d38e08d01103be454f48c8b50cc2f3.tar.gz
m2e-core-a4f8dc7748d38e08d01103be454f48c8b50cc2f3.tar.xz
m2e-core-a4f8dc7748d38e08d01103be454f48c8b50cc2f3.zip
Remove unnecessary casts.
Change-Id: I2dedf08a6fac4e5e030624ab0dd96a7a7701de04 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/WorkingSets.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java10
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java6
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/conversion/ProjectConversionParticipantSorter.java2
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java5
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java4
-rw-r--r--org.eclipse.m2e.jdt.ui/src/org/eclipse/m2e/jdt/ui/internal/actions/DownloadSourcesAction.java4
-rw-r--r--org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/GenericCommandActionDelegate.java9
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java4
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java4
19 files changed, 43 insertions, 45 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/WorkingSets.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/WorkingSets.java
index be44056a..1a537fe6 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/WorkingSets.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/WorkingSets.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Igor Fedorenko
+ * Copyright (c) 2013 Igor Fedorenko 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
@@ -123,7 +123,7 @@ public class WorkingSets {
for(IWorkingSet workingSet : manager.getAllWorkingSets()) {
try {
for(IAdaptable element : workingSet.getElements()) {
- IProject project = (IProject) element.getAdapter(IProject.class);
+ IProject project = element.getAdapter(IProject.class);
if(project != null) {
projects.add(project);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java
index b5902444..34a7ed74 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.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
@@ -95,7 +95,7 @@ public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExt
if(element instanceof IProject) {
project = (IProject) element;
} else if(element instanceof IAdaptable) {
- project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ project = ((IAdaptable) element).getAdapter(IProject.class);
}
if(project != null) {
projects.add(project);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java
index 368d27a1..997df5bc 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.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
@@ -49,7 +49,7 @@ public class DisableNatureAction implements IObjectActionDelegate {
if(element instanceof IProject) {
project = (IProject) element;
} else if(element instanceof IAdaptable) {
- project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ project = ((IAdaptable) element).getAdapter(IProject.class);
}
if(project != null) {
try {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java
index 965dfdf1..3a097b6f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.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
@@ -88,7 +88,7 @@ public class EnableNatureAction implements IObjectActionDelegate, IExecutableExt
if(element instanceof IProject) {
project = (IProject) element;
} else if(element instanceof IAdaptable) {
- project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ project = ((IAdaptable) element).getAdapter(IProject.class);
}
if(project != null) {
enableNature(project, structuredSelection.size() == 1);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
index 9db8d3e1..e76eb195 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.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
@@ -55,7 +55,7 @@ public class MavenPropertyTester extends PropertyTester {
boolean enableWorkspaceResolution = true;
IAdaptable adaptable = (IAdaptable) receiver;
- IProject projectAdapter = (IProject) adaptable.getAdapter(IProject.class);
+ IProject projectAdapter = adaptable.getAdapter(IProject.class);
if(projectAdapter != null) {
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.create(projectAdapter, new NullProgressMonitor());
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
index 11096699..a20b3c73 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.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
@@ -105,7 +105,7 @@ public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowAct
}
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- mavenProject = (MavenProject) targetPart.getAdapter(MavenProject.class);
+ mavenProject = targetPart.getAdapter(MavenProject.class);
}
protected MavenProject getMavenProject() {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
index edab488b..2b0b5fb6 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.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
@@ -148,12 +148,12 @@ public class SelectionUtil {
return (T) element;
}
if(element instanceof IAdaptable) {
- T adapter = (T) ((IAdaptable) element).getAdapter(type);
+ T adapter = ((IAdaptable) element).getAdapter(type);
if(adapter != null) {
return adapter;
}
}
- return (T) Platform.getAdapterManager().getAdapter(element, type);
+ return Platform.getAdapterManager().getAdapter(element, type);
}
public static IPath getSelectedLocation(IStructuredSelection selection) {
@@ -405,14 +405,14 @@ public class SelectionUtil {
} else if(o instanceof IWorkingSet) {
IWorkingSet workingSet = (IWorkingSet) o;
for(IAdaptable adaptable : workingSet.getElements()) {
- IProject project = (IProject) adaptable.getAdapter(IProject.class);
+ IProject project = adaptable.getAdapter(IProject.class);
safeAdd(project, projectList);
}
} else if(o instanceof IResource) {
safeAdd(((IResource) o).getProject(), projectList);
} else if(o instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) o;
- IProject project = (IProject) adaptable.getAdapter(IProject.class);
+ IProject project = adaptable.getAdapter(IProject.class);
safeAdd(project, projectList);
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java
index b8c604c2..1a8a0f49 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.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
@@ -232,7 +232,7 @@ public class WorkingSetGroup {
for(IWorkingSet workingSet : workingSetManager.getWorkingSets()) {
if(!workingSet.isEmpty()) {
IAdaptable[] elements = workingSet.getElements();
- IResource resource = (IResource) elements[0].getAdapter(IResource.class);
+ IResource resource = elements[0].getAdapter(IResource.class);
if(resource != null) {
workingSets.add(workingSet);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java
index 31d3c33e..a62039b1 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Sonatype, Inc.
+ * Copyright (c) 2011, 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
@@ -83,7 +83,7 @@ public final class PomHelper {
for(IEditorReference ref : page.getEditorReferences()) {
IEditorPart editor = ref.getEditor(false);
if(editor != null) {
- IDocument doc = (IDocument) editor.getAdapter(IDocument.class);
+ IDocument doc = editor.getAdapter(IDocument.class);
if(doc != null && doc.equals(document)) {
return true;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java
index 7060d3ad..40802f71 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Sonatype, Inc.
+ * Copyright (c) 2011, 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
@@ -44,7 +44,7 @@ public class LifecycleMappingPropertyPage extends PropertyPage {
public void setElement(IAdaptable element) {
super.setElement(element);
- IProject project = (IProject) getElement().getAdapter(IProject.class);
+ IProject project = getElement().getAdapter(IProject.class);
if(project != null) {
mappingsViewer.setTarget(project);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java
index 9dc7f03b..6a72ec9b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.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
@@ -164,7 +164,7 @@ public class MavenProjectPreferencePage extends PropertyPage {
}
private IProject getProject() {
- return (IProject) getElement().getAdapter(IProject.class);
+ return getElement().getAdapter(IProject.class);
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java
index 91b0e4ac..4556c8e9 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Sonatype, Inc.
+ * 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
@@ -174,7 +174,7 @@ public class MavenPluginActivator extends Plugin {
this.bundleContext = context;
try {
- this.qualifiedVersion = (String) getBundle().getHeaders().get(Constants.BUNDLE_VERSION);
+ this.qualifiedVersion = getBundle().getHeaders().get(Constants.BUNDLE_VERSION);
Version bundleVersion = Version.parseVersion(this.qualifiedVersion);
this.version = bundleVersion.getMajor() + "." + bundleVersion.getMinor() + "." + bundleVersion.getMicro(); //$NON-NLS-1$ //$NON-NLS-2$
} catch(IllegalArgumentException e) {
@@ -393,7 +393,7 @@ public class MavenPluginActivator extends Plugin {
public static String getUserAgent() {
// cast is necessary for eclipse 3.6 compatibility
- String osgiVersion = (String) Platform
+ String osgiVersion = Platform
.getBundle("org.eclipse.osgi").getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION); //$NON-NLS-1$
String m2eVersion = plugin.qualifiedVersion;
String javaVersion = System.getProperty("java.version", "unknown"); //$NON-NLS-1$ $NON-NLS-1$
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/conversion/ProjectConversionParticipantSorter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/conversion/ProjectConversionParticipantSorter.java
index 340ac6ff..331cd803 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/conversion/ProjectConversionParticipantSorter.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/conversion/ProjectConversionParticipantSorter.java
@@ -103,7 +103,7 @@ public class ProjectConversionParticipantSorter {
}
//Add edges
- for(Vertex converterVx : (List<Vertex>) dag.getVerticies()) {
+ for(Vertex converterVx : dag.getVerticies()) {
String converterId = converterVx.getLabel();
AbstractProjectConversionParticipant converter = converterMap.get(converterId);
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java
index 321d47d4..1dfdc0d2 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Sonatype, Inc.
+ * Copyright (c) 2011, 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
@@ -46,8 +46,7 @@ public class MavenDiscoveryInstallWizard extends PreselectedIUInstallWizard {
@Override
protected ProfileChangeOperation getProfileChangeOperation(Object[] elements) {
- RestartInstallOperation op = ((RestartInstallOperation) originalOperation)
- .copy(ElementUtils.elementsToIUs(elements));
+ RestartInstallOperation op = originalOperation.copy(ElementUtils.elementsToIUs(elements));
op.setProfileId(getProfileId());
return op;
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
index 1290c7c1..f29862d6 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.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
@@ -133,7 +133,7 @@ public class XmlUtils {
public static MavenProject extractMavenProject(ITextViewer sourceViewer) {
//look in the sourceViewer's cache only
if(sourceViewer instanceof IAdaptable) {
- return (MavenProject) ((IAdaptable) sourceViewer).getAdapter(MavenProject.class);
+ return ((IAdaptable) sourceViewer).getAdapter(MavenProject.class);
}
return null;
}
diff --git a/org.eclipse.m2e.jdt.ui/src/org/eclipse/m2e/jdt/ui/internal/actions/DownloadSourcesAction.java b/org.eclipse.m2e.jdt.ui/src/org/eclipse/m2e/jdt/ui/internal/actions/DownloadSourcesAction.java
index 9cf12da2..86a59718 100644
--- a/org.eclipse.m2e.jdt.ui/src/org/eclipse/m2e/jdt/ui/internal/actions/DownloadSourcesAction.java
+++ b/org.eclipse.m2e.jdt.ui/src/org/eclipse/m2e/jdt/ui/internal/actions/DownloadSourcesAction.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
@@ -72,7 +72,7 @@ public class DownloadSourcesAction implements IObjectActionDelegate, IExecutable
} else if(element instanceof IWorkingSet) {
IWorkingSet workingSet = (IWorkingSet) element;
for(IAdaptable adaptable : workingSet.getElements()) {
- IProject project = (IProject) adaptable.getAdapter(IProject.class);
+ IProject project = adaptable.getAdapter(IProject.class);
buildpathManager.scheduleDownload(project, ID_SOURCES.equals(id), ID_JAVADOC.equals(id));
}
}
diff --git a/org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/GenericCommandActionDelegate.java b/org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/GenericCommandActionDelegate.java
index 857a74d9..b13b71eb 100644
--- a/org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/GenericCommandActionDelegate.java
+++ b/org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/GenericCommandActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 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
@@ -172,8 +172,7 @@ public class GenericCommandActionDelegate implements IWorkbenchWindowActionDeleg
}
parameters.add(new Parameterization(parm, (String) parameterMap.get(parmName)));
}
- parameterizedCommand = new ParameterizedCommand(cmd,
- (Parameterization[]) parameters.toArray(new Parameterization[parameters.size()]));
+ parameterizedCommand = new ParameterizedCommand(cmd, parameters.toArray(new Parameterization[parameters.size()]));
} catch(NotDefinedException e) {
// command is bogus? No problem, we'll do nothing.
}
@@ -190,9 +189,9 @@ public class GenericCommandActionDelegate implements IWorkbenchWindowActionDeleg
return;
}
- handlerService = (IHandlerService) window.getService(IHandlerService.class);
+ handlerService = window.getService(IHandlerService.class);
if(parameterMap != null) {
- ICommandService commandService = (ICommandService) window.getService(ICommandService.class);
+ ICommandService commandService = window.getService(ICommandService.class);
createCommand(commandService);
}
}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java
index 0c6bac94..e9608d32 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Sonatype, Inc.
+ * Copyright (c) 2011, 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
@@ -45,7 +45,7 @@ public class RenameArtifactHandler extends AbstractHandler {
if(element instanceof IFile) {
rename((IFile) element);
} else if(element instanceof IAdaptable) {
- IProject project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ IProject project = ((IAdaptable) element).getAdapter(IProject.class);
if(project == null) {
return null;
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java
index a537a832..51d33e83 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.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
@@ -68,7 +68,7 @@ public class MavenCheckoutWizard extends AbstractMavenProjectWizard implements I
ArrayList<ScmUrl> urls = new ArrayList<ScmUrl>();
IAdapterManager adapterManager = Platform.getAdapterManager();
for(Iterator<?> it = selection.iterator(); it.hasNext();) {
- ScmUrl url = (ScmUrl) adapterManager.getAdapter(it.next(), ScmUrl.class);
+ ScmUrl url = adapterManager.getAdapter(it.next(), ScmUrl.class);
if(url != null) {
urls.add(url);
}

Back to the top