Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2015-03-25 10:58:12 -0400
committerMarc Khouzam2015-03-25 11:01:46 -0400
commit37890019cbe3b6b861def0d80d0f08e91ef18865 (patch)
treef7af0f410166df8c49144dd98f0d043671837b63 /codan/org.eclipse.cdt.codan.ui
parented97b40808590029c095499811c22e123862ac9c (diff)
downloadorg.eclipse.cdt-37890019cbe3b6b861def0d80d0f08e91ef18865.tar.gz
org.eclipse.cdt-37890019cbe3b6b861def0d80d0f08e91ef18865.tar.xz
org.eclipse.cdt-37890019cbe3b6b861def0d80d0f08e91ef18865.zip
Remove warnings caused by change to getAdaptable()
getAdaptable() in 4.5 M6 has changed to use generics, making casting its result no longer necessary. Change-Id: Idd943216a925576bb72c784b2c5a2a4b8e8b00d2 Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Diffstat (limited to 'codan/org.eclipse.cdt.codan.ui')
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/ToggleNatureAction.java2
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java2
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java2
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java2
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetails.java4
5 files changed, 6 insertions, 6 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/ToggleNatureAction.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/ToggleNatureAction.java
index 9a29c25fa9..45a89c1681 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/ToggleNatureAction.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/ToggleNatureAction.java
@@ -36,7 +36,7 @@ public class ToggleNatureAction 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) {
toggleNature(project, !hasCodanNature(project));
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java
index 2f976f5f2f..ae0d380c6f 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java
@@ -72,7 +72,7 @@ public class BuildPropertyPage extends FieldEditorPreferencePage implements IWor
@Override
public IAdaptable getElement() {
if (element.getAdapter(IProject.class) != null)
- return (IProject) element.getAdapter(IProject.class);
+ return element.getAdapter(IProject.class);
return null;
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
index 1abbd53851..1c76a41a50 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
@@ -256,7 +256,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
for (IEditorReference partRef : page.getEditorReferences()) {
IEditorPart editor = partRef.getEditor(false);
if (editor instanceof ICEditor) {
- IFile file = (IFile) editor.getEditorInput().getAdapter(IFile.class);
+ IFile file = editor.getEditorInput().getAdapter(IFile.class);
if (file != null && resource.getFullPath().isPrefixOf(file.getFullPath())) {
filesToUpdate.add(file);
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
index 39b860b716..8c3a33b61f 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
@@ -125,7 +125,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
if (element == null)
return element;
if (!(element instanceof IProject))
- return (IAdaptable) element.getAdapter(IProject.class);
+ return element.getAdapter(IProject.class);
return element;
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetails.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetails.java
index 02bbfb8f4a..8ff9b3d52a 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetails.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetails.java
@@ -105,7 +105,7 @@ public class ProblemDetails extends ViewPart {
description = new Link(area, SWT.WRAP);
description.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
description.addSelectionListener(linkSelAdapter);
- ISelectionService ser = (ISelectionService) getSite().getService(ISelectionService.class);
+ ISelectionService ser = getSite().getService(ISelectionService.class);
ser.addSelectionListener(new ISelectionListener() {
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
@@ -125,7 +125,7 @@ public class ProblemDetails extends ViewPart {
Object firstElement = ((IStructuredSelection) selection).getFirstElement();
IMarker marker = null;
if (firstElement instanceof IAdaptable) {
- marker = (IMarker) ((IAdaptable) firstElement).getAdapter(IMarker.class);
+ marker = ((IAdaptable) firstElement).getAdapter(IMarker.class);
} else if (firstElement instanceof IMarker) {
marker = (IMarker) firstElement;
}

Back to the top