Small bugfix
This commit is contained in:
parent
4a5ccfb6fe
commit
59378eb655
|
|
@ -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()});
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue