General clean up - setting up Eclipse 3.0 M6.

This commit is contained in:
Oliver Burn 2004-01-25 10:23:53 +00:00
parent 5bfd76b4de
commit 88b72c3df7
6 changed files with 12 additions and 28 deletions

View File

@ -167,7 +167,7 @@ public final class CheckUtils
switch (aType) {
case TokenTypes.NUM_FLOAT:
case TokenTypes.NUM_DOUBLE:
result = (double) Double.parseDouble(aText);
result = Double.parseDouble(aText);
break;
case TokenTypes.NUM_INT:
case TokenTypes.NUM_LONG:

View File

@ -94,9 +94,6 @@ public class RegexpHeaderCheck extends AbstractHeaderCheck
/** the compiled regular expressions */
private RE[] mHeaderRegexps;
/** number of current template line. */
private int mCurrentLineNo;
/**
* @param aLineNo a line number
* @return if <code>aLineNo</code> is one of the repeat header lines.

View File

@ -79,10 +79,9 @@ public class EqualsHashCodeCheck
{
DetailAST modifiers = (DetailAST) aAST.getFirstChild();
AST type = modifiers.getNextSibling();
AST methodName = type.getNextSibling();
DetailAST parameters =
(DetailAST) aAST.findFirstToken(TokenTypes.PARAMETERS);
final AST type = modifiers.getNextSibling();
final AST methodName = type.getNextSibling();
final DetailAST parameters = aAST.findFirstToken(TokenTypes.PARAMETERS);
if (type.getFirstChild().getType() == TokenTypes.LITERAL_BOOLEAN
&& "equals".equals(methodName.getText())

View File

@ -98,11 +98,11 @@ public class FallThroughCheck extends Check
case TokenTypes.LITERAL_FOR:
case TokenTypes.LITERAL_WHILE:
case TokenTypes.LITERAL_DO:
return checkLoop(aAST, aUseBreak, aUseContinue);
return checkLoop(aAST);
case TokenTypes.LITERAL_TRY:
return checkTry(aAST, aUseBreak, aUseContinue);
case TokenTypes.LITERAL_SWITCH:
return checkSwitch(aAST, aUseBreak, aUseContinue);
return checkSwitch(aAST, aUseContinue);
default:
return false;
}
@ -156,12 +156,9 @@ public class FallThroughCheck extends Check
* Checks if a given loop terminated by return, throw or,
* if allowed break, continue.
* @param aAST loop to check
* @param aUseBreak should we consider break as terminator.
* @param aUseContinue should we consider continue as terminator.
* @return true if loop is terminated.
*/
private boolean checkLoop(final DetailAST aAST, boolean aUseBreak,
boolean aUseContinue)
private boolean checkLoop(final DetailAST aAST)
{
DetailAST loopBody = null;
if (aAST.getType() == TokenTypes.LITERAL_DO) {
@ -208,12 +205,10 @@ public class FallThroughCheck extends Check
* Checks if a given switch terminated by return, throw or,
* if allowed break, continue.
* @param aAST loop to check
* @param aUseBreak should we consider break as terminator.
* @param aUseContinue should we consider continue as terminator.
* @return true if switch is terminated.
*/
private boolean checkSwitch(final DetailAST aAST, boolean aUseBreak,
boolean aUseContinue)
private boolean checkSwitch(final DetailAST aAST, boolean aUseContinue)
{
DetailAST caseGroup = aAST.findFirstToken(TokenTypes.CASE_GROUP);
boolean isTerminated = (caseGroup != null);

View File

@ -41,13 +41,8 @@ public abstract class AbstractJ2eeCheck
*/
protected void log(DetailAST aAST, String aKey, Object[] aArgs)
{
final DetailAST nameAST =
(DetailAST) aAST.findFirstToken(TokenTypes.IDENT);
log(
nameAST.getLineNo(),
nameAST.getColumnNo(),
aKey,
aArgs);
final DetailAST nameAST = aAST.findFirstToken(TokenTypes.IDENT);
log(nameAST.getLineNo(), nameAST.getColumnNo(), aKey, aArgs);
}
/**
@ -60,8 +55,7 @@ public abstract class AbstractJ2eeCheck
*/
protected void logName(DetailAST aAST, String aKey, Object[] aArgs)
{
final DetailAST nameAST =
(DetailAST) aAST.findFirstToken(TokenTypes.IDENT);
final DetailAST nameAST = aAST.findFirstToken(TokenTypes.IDENT);
final String name = nameAST.getText();
final Object[] fullArgs = new Object[aArgs.length + 1];
System.arraycopy(aArgs, 0, fullArgs, 1, aArgs.length);

View File

@ -262,8 +262,7 @@ public abstract class AbstractClassCouplingCheck extends Check
*/
private void addReferencedClassName(DetailAST aAST)
{
final String className =
FullIdent.createFullIdent((DetailAST) aAST).getText();
final String className = FullIdent.createFullIdent(aAST).getText();
addReferencedClassName(className);
}