Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 11:20:42 -0500
committerJonah Graham2018-11-22 16:53:35 -0500
commit8844a8f9f22802fedffa3cb2a8a21b041aa64b74 (patch)
tree311bce2a3fbe500e879b44c270b0d2ee24fe01af /core
parent8985c7b63f04ad139e8b93160798e642d2addc55 (diff)
downloadorg.eclipse.cdt-8844a8f9f22802fedffa3cb2a8a21b041aa64b74.tar.gz
org.eclipse.cdt-8844a8f9f22802fedffa3cb2a8a21b041aa64b74.tar.xz
org.eclipse.cdt-8844a8f9f22802fedffa3cb2a8a21b041aa64b74.zip
Bug 540373: Cleanup: Remove unnecessary casts
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Remove unnecessary casts and completing the wizard Change-Id: I287d4066b12fc19d7f73a016e11c9405abb4ceb9
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java6
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/search/SearchReferencesAcrossLanguagesTest.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTest.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTests.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleViewer.java2
8 files changed, 10 insertions, 10 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
index 76500a515d..d3d099b603 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
@@ -1029,7 +1029,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
pdomBinding = createBinding(type, method, fileLocalRec);
} else if (!getPDOM().hasLastingDefinition(pdomBinding)) {
pdomBinding.update(this, method);
- old.remove((ICPPMethod) pdomBinding);
+ old.remove(pdomBinding);
// Update the tags based on the tags from the new binding. This was in
// PDOMBinding.update, but not all subclasses (e.g., PDOMCPPFunction)
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java
index 797545fc72..431d37f4fb 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/FindIASTNameDialog.java
@@ -85,7 +85,7 @@ class FindIASTNameDialog extends Dialog {
updateCombo(fFindField, fFindHistory);
if (!fFindHistory.equals(oldList) && !fFindHistory.isEmpty())
- fFindField.setText((String) fFindHistory.get(0));
+ fFindField.setText(fFindHistory.get(0));
else
fFindField.setText(oldText);
if (findFieldHadFocus())
@@ -880,7 +880,7 @@ class FindIASTNameDialog extends Dialog {
} else {
if (BLANK_STRING.equals(fFindField.getText())) {
if (fFindHistory.size() > 0)
- fFindField.setText((String) fFindHistory.get(0));
+ fFindField.setText(fFindHistory.get(0));
else
fFindField.setText(BLANK_STRING);
}
@@ -1032,7 +1032,7 @@ class FindIASTNameDialog extends Dialog {
if (editor == null)
return null;
- return (IEditorStatusLine) editor.getAdapter(IEditorStatusLine.class);
+ return editor.getAdapter(IEditorStatusLine.class);
}
/**
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java
index 01171a1154..df477f2d7f 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java
@@ -148,7 +148,7 @@ public class ShowInDOMViewAction extends ActionDelegate implements IEditorAction
return location.toOSString();
}
}
- ILocationProvider locationProvider = (ILocationProvider) input.getAdapter(ILocationProvider.class);
+ ILocationProvider locationProvider = input.getAdapter(ILocationProvider.class);
if (locationProvider != null) {
IPath location = locationProvider.getPath(input);
if (location != null) {
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/search/SearchReferencesAcrossLanguagesTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/search/SearchReferencesAcrossLanguagesTest.java
index 610e011d39..bac067c2ec 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/search/SearchReferencesAcrossLanguagesTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/search/SearchReferencesAcrossLanguagesTest.java
@@ -105,7 +105,7 @@ public class SearchReferencesAcrossLanguagesTest extends BaseUITestCase {
assertNotNull(page);
IEditorPart editor = IDE.openEditor(page, f_h, CUIPlugin.EDITOR_ID);
assertNotNull(editor);
- CEditor ceditor = (CEditor) editor.getAdapter(CEditor.class);
+ CEditor ceditor = editor.getAdapter(CEditor.class);
assertNotNull(ceditor);
ceditor.selectAndReveal(hcontent.indexOf("m1"), 2);
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTest.java
index 493ec75d84..0fad01f43f 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTest.java
@@ -131,7 +131,7 @@ public class FoldingTest extends FoldingTestBase {
}
private void assertNoKeyCollisions() {
- ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor
+ ProjectionAnnotationModel model = fEditor
.getAdapter(ProjectionAnnotationModel.class);
assertNotNull(model);
int annotations = 0;
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java
index ebe8123d7d..8cec47298e 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/FoldingTestBase.java
@@ -253,7 +253,7 @@ abstract public class FoldingTestBase extends BaseUITestCase {
protected PositionAndCollapsed[] getFoldingPositions() {
List<PositionAndCollapsed> positionAndCollapseds = new ArrayList<PositionAndCollapsed>();
- ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor
+ ProjectionAnnotationModel model = fEditor
.getAdapter(ProjectionAnnotationModel.class);
assertNotNull(model);
for (Iterator<Annotation> iter = model.getAnnotationIterator(); iter.hasNext();) {
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTests.java
index 1fcaceb245..0cdc9c8856 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTests.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTests.java
@@ -141,7 +141,7 @@ public abstract class BaseSelectionTests extends BaseUITestCase {
final IASTName[] result = { null };
if (sel instanceof ITextSelection) {
final ITextSelection textSel = (ITextSelection) sel;
- ITranslationUnit tu = (ITranslationUnit) editor.getInputCElement();
+ ITranslationUnit tu = editor.getInputCElement();
IStatus ok = ASTProvider.getASTProvider().runOnAST(tu, ASTProvider.WAIT_IF_OPEN, monitor,
new ASTRunnable() {
@Override
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleViewer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleViewer.java
index 205f713f1f..a1725ec287 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleViewer.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleViewer.java
@@ -274,7 +274,7 @@ public class BuildConsoleViewer extends TextViewer
if (partitioner == null)
return;
- BuildConsolePartition partition = (BuildConsolePartition) partitioner.getPartition(event.lineOffset);
+ BuildConsolePartition partition = partitioner.getPartition(event.lineOffset);
// Set background for error partitions
if (partition != null) {
String type = partition.getType();

Back to the top