Fix annoying errors in Eclipse.

This commit is contained in:
Oliver Burn 2005-05-21 01:31:04 +00:00
parent f0be1ede99
commit 21d2edeffd
4 changed files with 22 additions and 51 deletions

View File

@ -258,7 +258,7 @@ public class Resolver extends DefinitionTraverser {
SymTabAST node = block.getTreeNode();
SymTabAST conditional =
(SymTabAST) (node.findFirstToken(TokenTypes.EXPR));
(node.findFirstToken(TokenTypes.EXPR));
resolveExpression(conditional, block, null, true);
SymTabAST message = (SymTabAST) conditional.getNextSibling();
@ -366,7 +366,7 @@ public class Resolver extends DefinitionTraverser {
}
else {
resolveExpression(
(SymTabAST) (forEach.findFirstToken(TokenTypes.EXPR)),
(forEach.findFirstToken(TokenTypes.EXPR)),
block,
null,
true);
@ -394,7 +394,7 @@ public class Resolver extends DefinitionTraverser {
SymTabAST node = block.getTreeNode();
SymTabAST conditional =
(SymTabAST) (node.findFirstToken(TokenTypes.EXPR));
(node.findFirstToken(TokenTypes.EXPR));
resolveExpression(conditional, block, null, true);
SymTabAST body = (SymTabAST) conditional.getNextSibling();
@ -441,7 +441,7 @@ public class Resolver extends DefinitionTraverser {
SymTabAST node = block.getTreeNode();
SymTabAST condition =
(SymTabAST) (node.findFirstToken(TokenTypes.EXPR));
(node.findFirstToken(TokenTypes.EXPR));
SymTabAST slist = (SymTabAST) (condition.getNextSibling());
// handle Checkstyle grammar
if (slist.getType() == TokenTypes.RPAREN) {
@ -457,7 +457,7 @@ public class Resolver extends DefinitionTraverser {
SymTabAST slist = (SymTabAST) node.getFirstChild();
SymTabAST condition =
(SymTabAST) node.findFirstToken(TokenTypes.EXPR);
node.findFirstToken(TokenTypes.EXPR);
handleSList(slist, block);
resolveExpression(condition, block, null, true);
@ -1360,7 +1360,7 @@ public class Resolver extends DefinitionTraverser {
SymTabAST nameNode = (SymTabAST) (constructor.getFirstChild());
//SymTabAST parametersNode = (SymTabAST) (nameNode.getNextSibling());
SymTabAST parametersNode =
(SymTabAST) constructor.findFirstToken(TokenTypes.ELIST);
constructor.findFirstToken(TokenTypes.ELIST);
SymTabAST nameIdent = null;
if (nameNode.getType() == TokenTypes.IDENT) {
nameIdent = nameNode;
@ -1413,11 +1413,11 @@ public class Resolver extends DefinitionTraverser {
while (expr != null) {
if (expr.getType() != TokenTypes.COMMA) {
IClass parameter =
(IClass) resolveExpression((SymTabAST) (expr
.getFirstChild()),
location,
context,
referencePhase);
resolveExpression((SymTabAST) (expr
.getFirstChild()),
location,
context,
referencePhase);
parameters.add(parameter);
}
@ -1566,18 +1566,18 @@ public class Resolver extends DefinitionTraverser {
SymTabAST leftChild = findLeftChild(expression);
IClass leftType =
(IClass) (resolveExpression(leftChild,
location,
context,
referencePhase));
(resolveExpression(leftChild,
location,
context,
referencePhase));
SymTabAST rightChild = findRightSibling(leftChild);
IClass rightType =
(IClass) (resolveExpression(rightChild,
location,
context,
referencePhase));
(resolveExpression(rightChild,
location,
context,
referencePhase));
result = binaryResultType(leftType, rightType);
@ -1642,8 +1642,8 @@ public class Resolver extends DefinitionTraverser {
else {
result =
PrimitiveClasses.binaryPromote(
(ExternalClass) a,
(ExternalClass) b);
a,
b);
}
return result;

View File

@ -49,8 +49,6 @@ import java.util.Vector;
*/
public abstract class Scope extends Definition {
private Vector unresolvedStuff = new Vector();
// rename to references?
protected SortedSet referencesInScope = new TreeSet();

View File

@ -28,7 +28,6 @@
package com.puppycrawl.tools.checkstyle.checks.usage.transmogrify;
import java.io.File;
import java.util.Hashtable;
import java.util.Vector;
@ -114,7 +113,7 @@ public class ScopeIndex {
public void addScope(Scope scope) {
final SymTabAST SymTabAST = scope.getTreeNode();
final File file = SymTabAST.getFile();
SymTabAST.getFile();
Vector fileVector =
getFileVector(scope.getTreeNode().getFile().getAbsolutePath());

View File

@ -243,7 +243,6 @@ public class SymTabAST
*/
public Span finishChildren(File file) {
Span result = null;
SymTabAST previousSibling = null;
SymTabAST current = (SymTabAST) getFirstChild();
if (current == null) {
@ -263,9 +262,7 @@ public class SymTabAST
}
}
SymTabAST temp = current;
current = (SymTabAST) current.getNextSibling();
previousSibling = temp;
}
}
@ -326,29 +323,6 @@ public class SymTabAST
return result;
}
/**
* makes a new copy of the current <code>SymTabAST</code>. Uses the
* initialize(AST t) method to copy properties for each cloned node.
*
* @return <code>SymTabAST</code> a full tree copy of the current tree
*/
private SymTabAST treeCopy()
{
SymTabAST copyOfThis = SymTabASTFactory.create(getType(), getText());
copyOfThis.initialize(this);
if (getFirstChild() != null) {
copyOfThis.setFirstChild(((SymTabAST) getFirstChild()).treeCopy());
}
if (getNextSibling() != null) {
copyOfThis.setNextSibling(
((SymTabAST) getNextSibling()).treeCopy());
}
return copyOfThis;
}
/**
* prints the line, column and file for this node for debugging purpose
* @return <code>String</code>