Small bugfix

This commit is contained in:
Oliver Burn 2002-11-23 00:53:40 +00:00
parent 4a5ccfb6fe
commit 59378eb655
3 changed files with 16 additions and 1 deletions

View File

@ -113,8 +113,12 @@ public class WhitespaceAroundCheck
if ((after < line.length())
&& !Character.isWhitespace(line.charAt(after))
// Check for "return;"
&& !((aAST.getType() == TokenTypes.LITERAL_RETURN)
&& (aAST.getFirstChild().getType() == TokenTypes.SEMI)))
&& (aAST.getFirstChild().getType() == TokenTypes.SEMI))
// Check for "})". Happens with anon-inners
&& !((aAST.getType() == TokenTypes.RCURLY)
&& (line.charAt(after) == ')')))
{
log(aAST.getLineNo(), aAST.getColumnNo() + aAST.getText().length(),
"ws.notFollowed", new Object[]{aAST.getText()});

View File

@ -155,4 +155,13 @@ class InputWhitespace
// missing WS around colon
assert true:"Whups";
}
/** another check */
void donBradman(Runnable aRun)
{
donBradman(new Runnable() {
public void run() {
}
});
}
}

View File

@ -55,6 +55,8 @@ public class ParenPadCheckTest
"150:32: ')' is not preceeded with whitespace.",
"153:16: '(' is not followed by whitespace.",
"153:20: ')' is not preceeded with whitespace.",
"162:20: '(' is not followed by whitespace.",
"165:10: ')' is not preceeded with whitespace.",
};
verify(c, fname, expected);
}