Cleanup useless casts.
Change-Id: I00a7bdf2da1c1a6596a379d105b9f235ad7bd3bd
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/plugins/org.eclipse.dltk.ruby.basicdebugger/src/org/eclipse/dltk/ruby/basicdebugger/RubyBasicDebuggerRunner.java b/plugins/org.eclipse.dltk.ruby.basicdebugger/src/org/eclipse/dltk/ruby/basicdebugger/RubyBasicDebuggerRunner.java
index 758249c..55179e3 100644
--- a/plugins/org.eclipse.dltk.ruby.basicdebugger/src/org/eclipse/dltk/ruby/basicdebugger/RubyBasicDebuggerRunner.java
+++ b/plugins/org.eclipse.dltk.ruby.basicdebugger/src/org/eclipse/dltk/ruby/basicdebugger/RubyBasicDebuggerRunner.java
@@ -1,11 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 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
* http://www.eclipse.org/legal/epl-v10.html
*
-
*******************************************************************************/
package org.eclipse.dltk.ruby.basicdebugger;
@@ -60,7 +59,7 @@
PreferencesLookupDelegate delegate, ILaunch launch)
throws CoreException {
IEnvironment env = getInstall().getEnvironment();
- IExecutionEnvironment exeEnv = (IExecutionEnvironment) env
+ IExecutionEnvironment exeEnv = env
.getAdapter(IExecutionEnvironment.class);
IDeployment deployment = exeEnv.createDeployment();
if (deployment == null) {
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/mixin/RubyMixinBuildVisitor.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/mixin/RubyMixinBuildVisitor.java
index 99836df..8fbaa4f 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/mixin/RubyMixinBuildVisitor.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/mixin/RubyMixinBuildVisitor.java
@@ -1,11 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 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
* http://www.eclipse.org/legal/epl-v10.html
*
-
*******************************************************************************/
package org.eclipse.dltk.ruby.internal.parser.mixin;
@@ -480,7 +479,7 @@
public boolean visit(CallExpression call) throws Exception {
if (call.getReceiver() == null
&& call.getName().equals("include") && call.getArgs().getChilds().size() > 0) { //$NON-NLS-1$
- ASTNode expr = (ASTNode) call.getArgs().getChilds().get(0);
+ ASTNode expr = call.getArgs().getChilds().get(0);
if (expr instanceof RubyCallArgument)
expr = ((RubyCallArgument) expr).getValue();
Scope scope = peekScope();
@@ -499,7 +498,7 @@
} else if (call.getReceiver() == null
&& call.getName().equals("extend") //$NON-NLS-1$
&& call.getArgs().getChilds().size() > 0) {
- ASTNode expr = (ASTNode) call.getArgs().getChilds().get(0);
+ ASTNode expr = call.getArgs().getChilds().get(0);
if (expr instanceof RubyCallArgument)
expr = ((RubyCallArgument) expr).getValue();
scopes.push(new MetaClassScope(call, peekScope().getClassKey()));
@@ -655,7 +654,7 @@
}
ASTListNode superClasses = declaration.getSuperClasses();
if (superClasses != null && superClasses.getChilds().size() == 1) {
- ASTNode s = (ASTNode) superClasses.getChilds().get(0);
+ ASTNode s = superClasses.getChilds().get(0);
// if (this.sourceModule != null) {
SuperclassReferenceInfo ref = new SuperclassReferenceInfo(s,
this.module, sourceModule);
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/visitors/RubySourceElementRequestor.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/visitors/RubySourceElementRequestor.java
index 57b86f7..ed26a0c 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/visitors/RubySourceElementRequestor.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/visitors/RubySourceElementRequestor.java
@@ -1,11 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 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
* http://www.eclipse.org/legal/epl-v10.html
*
-
*******************************************************************************/
package org.eclipse.dltk.ruby.internal.parser.visitors;
@@ -152,7 +151,7 @@
if (!inMethod) {
// For module static of class static variables.
- if (canAddVariables((ASTNode) fNodes.peek(), var.getName())) {
+ if (canAddVariables(fNodes.peek(), var.getName())) {
ISourceElementRequestor.FieldInfo info = new ISourceElementRequestor.FieldInfo();
info.modifiers = Modifiers.AccStatic;
info.name = var.getName();
diff --git a/plugins/org.eclipse.dltk.ruby.debug.ui/src/org/eclipse/dltk/ruby/internal/debug/ui/RubyVariableColumnPresentationFactory.java b/plugins/org.eclipse.dltk.ruby.debug.ui/src/org/eclipse/dltk/ruby/internal/debug/ui/RubyVariableColumnPresentationFactory.java
index 0b1da72..62cf290 100644
--- a/plugins/org.eclipse.dltk.ruby.debug.ui/src/org/eclipse/dltk/ruby/internal/debug/ui/RubyVariableColumnPresentationFactory.java
+++ b/plugins/org.eclipse.dltk.ruby.debug.ui/src/org/eclipse/dltk/ruby/internal/debug/ui/RubyVariableColumnPresentationFactory.java
@@ -28,7 +28,7 @@
if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId())) {
if (element instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable)element;
- frame = (IScriptStackFrame) adaptable.getAdapter(IScriptStackFrame.class);
+ frame = adaptable.getAdapter(IScriptStackFrame.class);
}
}
return frame != null;
diff --git a/plugins/org.eclipse.dltk.ruby.debug.ui/src/org/eclipse/dltk/ruby/internal/debug/ui/console/RubyConsoleSourceModuleLookup.java b/plugins/org.eclipse.dltk.ruby.debug.ui/src/org/eclipse/dltk/ruby/internal/debug/ui/console/RubyConsoleSourceModuleLookup.java
index 1872ae0..3019826 100644
--- a/plugins/org.eclipse.dltk.ruby.debug.ui/src/org/eclipse/dltk/ruby/internal/debug/ui/console/RubyConsoleSourceModuleLookup.java
+++ b/plugins/org.eclipse.dltk.ruby.debug.ui/src/org/eclipse/dltk/ruby/internal/debug/ui/console/RubyConsoleSourceModuleLookup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 xored software, Inc.
+ * Copyright (c) 2008, 2016 xored software, Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -27,7 +27,6 @@
import org.eclipse.dltk.core.environment.EnvironmentPathUtils;
import org.eclipse.dltk.core.search.IDLTKSearchScope;
import org.eclipse.dltk.core.search.SearchEngine;
-import org.eclipse.dltk.internal.core.ProjectFragment;
import org.eclipse.dltk.internal.core.util.Util;
public class RubyConsoleSourceModuleLookup {
@@ -85,7 +84,7 @@
}
public static boolean isIncluded(IProjectFragment fragment, IPath path) {
- final IProjectFragment root = (IProjectFragment) fragment;
+ final IProjectFragment root = fragment;
return !Util.isExcluded(path, root, false);
}
diff --git a/plugins/org.eclipse.dltk.ruby.fastdebugger/src/org/eclipse/dltk/ruby/fastdebugger/FastDebuggerRunner.java b/plugins/org.eclipse.dltk.ruby.fastdebugger/src/org/eclipse/dltk/ruby/fastdebugger/FastDebuggerRunner.java
index a63ad45..a4257f7 100644
--- a/plugins/org.eclipse.dltk.ruby.fastdebugger/src/org/eclipse/dltk/ruby/fastdebugger/FastDebuggerRunner.java
+++ b/plugins/org.eclipse.dltk.ruby.fastdebugger/src/org/eclipse/dltk/ruby/fastdebugger/FastDebuggerRunner.java
@@ -70,7 +70,7 @@
}
IEnvironment env = getInstall().getEnvironment();
- IExecutionEnvironment exeEnv = (IExecutionEnvironment) env
+ IExecutionEnvironment exeEnv = env
.getAdapter(IExecutionEnvironment.class);
IDeployment deployment = exeEnv.createDeployment();
if (deployment == null) {
@@ -159,7 +159,7 @@
public boolean resolveRubyDebugGemExists() {
IEnvironment environment = getInstall().getEnvironment();
- IExecutionEnvironment executionEnvironment = (IExecutionEnvironment) environment
+ IExecutionEnvironment executionEnvironment = environment
.getAdapter(IExecutionEnvironment.class);
Bundle bundle = FastDebuggerPlugin.getDefault().getBundle();
diff --git a/plugins/org.eclipse.dltk.ruby.launching/src/org/eclipse/dltk/ruby/internal/launching/RubyGenericInstallType.java b/plugins/org.eclipse.dltk.ruby.launching/src/org/eclipse/dltk/ruby/internal/launching/RubyGenericInstallType.java
index 71b765d..38a8756 100644
--- a/plugins/org.eclipse.dltk.ruby.launching/src/org/eclipse/dltk/ruby/internal/launching/RubyGenericInstallType.java
+++ b/plugins/org.eclipse.dltk.ruby.launching/src/org/eclipse/dltk/ruby/internal/launching/RubyGenericInstallType.java
@@ -70,7 +70,7 @@
null);
}
IEnvironment environment = installLocation.getEnvironment();
- IExecutionEnvironment executionEnvironment = (IExecutionEnvironment) environment
+ IExecutionEnvironment executionEnvironment = environment
.getAdapter(IExecutionEnvironment.class);
String output = ScriptLaunchUtil.runEmbeddedScriptReadContent(
diff --git a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/docs/RiHelper.java b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/docs/RiHelper.java
index 57d249e..60d176b 100644
--- a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/docs/RiHelper.java
+++ b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/docs/RiHelper.java
@@ -77,7 +77,7 @@
}
IEnvironment env = install.getEnvironment();
- IExecutionEnvironment exeEnv = (IExecutionEnvironment) env
+ IExecutionEnvironment exeEnv = env
.getAdapter(IExecutionEnvironment.class);
deployment = exeEnv.createDeployment();
if (deployment == null) {
diff --git a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/hyperlink/RubyRequireHyperlink.java b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/hyperlink/RubyRequireHyperlink.java
index 63567c0..c98a6b1 100644
--- a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/hyperlink/RubyRequireHyperlink.java
+++ b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/hyperlink/RubyRequireHyperlink.java
@@ -125,7 +125,7 @@
}
private void showMessage(String message) {
- final IEditorStatusLine statusLine = (IEditorStatusLine) editor
+ final IEditorStatusLine statusLine = editor
.getAdapter(IEditorStatusLine.class);
if (statusLine != null) {
statusLine.setMessage(true, message, null);