clean-up: resolve some warnings
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
index 72bca9a..660ea37 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
@@ -107,7 +107,6 @@
* + base method specs (from AbstractMethodMappingDeclaration.resolveMethodSpecs(..))
* + the message send within a callout wrapper (from MessageSend.resolveType(..))
*/
-@SuppressWarnings({"rawtypes", "unchecked"})
public abstract class Expression extends Statement {
//{ObjectTeams: baseclass decapsulation support:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/OTQualifiedAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/OTQualifiedAllocationExpression.java
index 28763b4..0518fa5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/OTQualifiedAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/OTQualifiedAllocationExpression.java
@@ -21,8 +21,6 @@
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.eclipse.jdt.internal.compiler.CompilationResult;
-import org.eclipse.jdt.internal.compiler.CompilationResult.CheckPoint;
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.eclipse.jdt.internal.compiler.ast.CastExpression;
import org.eclipse.jdt.internal.compiler.ast.Expression;
@@ -114,8 +112,6 @@
if (this.anonymousType == null && this.creatorCall == null && this.enclosingInstance == null) // special case during code assist
return super.resolveType(scope);
- CompilationResult compilationResult = scope.referenceContext().compilationResult();
- CheckPoint cp = compilationResult.getCheckPoint(scope.referenceContext());
this.hasEnclosingInstanceProblem = false;
if (this.anonymousType == null && this.creatorCall == null) { // no double processing
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectMapper.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectMapper.java
index 5e5c57d..23096e9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectMapper.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectMapper.java
@@ -400,14 +400,6 @@
return newSuperclass.getExactConstructor(new TypeBinding[0]);
}
- private static boolean hasMethod(ReferenceBinding clazz, MethodBinding meth) {
- MethodBinding[] methods = clazz.methods();
- for (int i = 0; i < methods.length; i++) {
- if (meth == methods[i])
- return true;
- }
- return false;
- }
/**
* searches for a matching field in the destination Team
* For this the method will compare all roles from destination Team with
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java
index 3334fda..046d47b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Config.java
@@ -215,7 +215,7 @@
configStack.push(config); // be defensive, put it back
}
if (configStack.empty())
- _configs.set(null); // remove entire Stack //TODO (carp): optimization: don't remove
+ _configs.set(null); // remove entire Stack
}
}
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java
index 932aa93..056829c 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java
@@ -221,7 +221,6 @@
public static final ChildPropertyDescriptor FAKED_ROLE_VARIABLE =
new ChildPropertyDescriptor(SingleVariableDeclaration.class, "fakedRoleVariable", SingleVariableDeclaration.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
- @SuppressWarnings("unchecked")
SingleVariableDeclaration newFakedRoleVariable(LiftingType liftingType) {
if (this.fakedRoleVariable != null)
return null;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
index 19e41bb..1f183e7 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
@@ -575,7 +575,6 @@
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
- @SuppressWarnings("unchecked")
ASTNode clone0(AST target) {
TypeDeclaration result = new TypeDeclaration(target);
result.setSourceRange(getStartPosition(), getLength());
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTNodeCreator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTNodeCreator.java
index 10ca0f6..79e935d 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTNodeCreator.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTNodeCreator.java
@@ -57,13 +57,11 @@
*
* This class provides helperMethods for the creation of DOMAST-Nodes.
*
- * @version $Id: ASTNodeCreator.java 22581 2009-09-24 10:26:48Z stephan $
*/
-@SuppressWarnings("unchecked") // assigning from parameterless lists :(
public class ASTNodeCreator
{
- public static CompilationUnit createCU(AST ast, PackageDeclaration pack, List importList, List typeList)
+ public static CompilationUnit createCU(AST ast, PackageDeclaration pack, List<ImportDeclaration> importList, List<TypeDeclaration> typeList)
{
CompilationUnit newCU = ast.newCompilationUnit();
@@ -75,7 +73,7 @@
List<ImportDeclaration> cuImportList = newCU.imports();
for (int idx = 0; idx < importList.size(); idx++)
{
- ImportDeclaration tmp = (ImportDeclaration)importList.get(idx);
+ ImportDeclaration tmp = importList.get(idx);
cuImportList.add(tmp);
}
}
@@ -85,7 +83,7 @@
List<TypeDeclaration> cuTypeList = newCU.types();
for (int idx = 0; idx < typeList.size(); idx++)
{
- TypeDeclaration tmp = (TypeDeclaration)typeList.get(idx);
+ TypeDeclaration tmp = typeList.get(idx);
cuTypeList.add(tmp);
}
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
index fcad6b1..f55632c 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
@@ -1708,7 +1708,7 @@
/* (non-Javadoc)
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CallinMappingDeclaration)
*/
- @SuppressWarnings({ "nls", "rawtypes" })
+ @SuppressWarnings("nls")
public boolean visit(CallinMappingDeclaration node)
{
ASTNode javadoc = getChildNode(node, CallinMappingDeclaration.JAVADOC_PROPERTY);