diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java index 627568a0d..53ab47505 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java @@ -664,7 +664,7 @@ class Verifier final int after = aColNo - 1; if (after < line.length()) { if (Character.isWhitespace(line.charAt(after))) { - log(aLineNo, "'(' is followed by whitespace."); + log(aLineNo, after, "'(' is followed by whitespace."); } } } @@ -686,7 +686,7 @@ class Verifier final int before = aColNo - 3; if (before >= 0) { if (Character.isWhitespace(line.charAt(before))) { - log(aLineNo, "')' is preceeded by whitespace."); + log(aLineNo, before, "')' is preceeded by whitespace."); } } } diff --git a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java index 67bc8cae8..845a0df84 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java @@ -112,13 +112,13 @@ public class CheckerTest filepath + ":37: 'synchronized' is not followed by whitespace.", filepath + ":39: 'try' is not followed by whitespace.", filepath + ":41: 'catch' is not followed by whitespace.", - filepath + ":58: '(' is followed by whitespace.", - filepath + ":58: ')' is preceeded by whitespace.", filepath + ":58: 'if' is not followed by whitespace.", + filepath + ":58:12: '(' is followed by whitespace.", + filepath + ":58:36: ')' is preceeded by whitespace.", filepath + ":59:9: '{' should be on the previous line.", filepath + ":63:9: '{' should be on the previous line.", - filepath + ":74: '(' is followed by whitespace.", - filepath + ":74: ')' is preceeded by whitespace.", + filepath + ":74:13: '(' is followed by whitespace.", + filepath + ":74:18: ')' is preceeded by whitespace.", filepath + ":75:9: '{' should be on the previous line.", filepath + ":76: 'return' is not followed by whitespace.", filepath + ":79:9: '{' should be on the previous line.", @@ -553,14 +553,14 @@ public class CheckerTest final String filepath = getPath("InputScopeAnonInner.java"); assertNotNull(c); final String[] expected = { - filepath + ":37: '(' is followed by whitespace.", - filepath + ":39: '(' is followed by whitespace.", - filepath + ":39: ')' is preceeded by whitespace.", - filepath + ":43: ')' is preceeded by whitespace.", - filepath + ":51: '(' is followed by whitespace.", - filepath + ":53: '(' is followed by whitespace.", - filepath + ":53: ')' is preceeded by whitespace.", - filepath + ":57: ')' is preceeded by whitespace.", + filepath + ":37:34: '(' is followed by whitespace.", + filepath + ":39:42: '(' is followed by whitespace.", + filepath + ":39:57: ')' is preceeded by whitespace.", + filepath + ":43:14: ')' is preceeded by whitespace.", + filepath + ":51:34: '(' is followed by whitespace.", + filepath + ":53:42: '(' is followed by whitespace.", + filepath + ":53:57: ')' is preceeded by whitespace.", + filepath + ":57:14: ')' is preceeded by whitespace.", }; verify(c, filepath, expected); } @@ -574,16 +574,16 @@ public class CheckerTest assertNotNull(c); final String[] expected = { filepath + ":26: method is missing a Javadoc comment.", - filepath + ":37: '(' is followed by whitespace.", - filepath + ":39: '(' is followed by whitespace.", - filepath + ":39: ')' is preceeded by whitespace.", + filepath + ":37:34: '(' is followed by whitespace.", filepath + ":39: method is missing a Javadoc comment.", - filepath + ":43: ')' is preceeded by whitespace.", - filepath + ":51: '(' is followed by whitespace.", - filepath + ":53: '(' is followed by whitespace.", - filepath + ":53: ')' is preceeded by whitespace.", + filepath + ":39:42: '(' is followed by whitespace.", + filepath + ":39:57: ')' is preceeded by whitespace.", + filepath + ":43:14: ')' is preceeded by whitespace.", + filepath + ":51:34: '(' is followed by whitespace.", filepath + ":53: method is missing a Javadoc comment.", - filepath + ":57: ')' is preceeded by whitespace.", + filepath + ":53:42: '(' is followed by whitespace.", + filepath + ":53:57: ')' is preceeded by whitespace.", + filepath + ":57:14: ')' is preceeded by whitespace.", }; verify(c, filepath, expected); } @@ -613,14 +613,14 @@ public class CheckerTest assertNotNull(c); final String[] expected = { filepath + ":3: Line does not match expected header line of '// Created: 2002'.", - filepath + ":37: '(' is followed by whitespace.", - filepath + ":39: '(' is followed by whitespace.", - filepath + ":39: ')' is preceeded by whitespace.", - filepath + ":43: ')' is preceeded by whitespace.", - filepath + ":51: '(' is followed by whitespace.", - filepath + ":53: '(' is followed by whitespace.", - filepath + ":53: ')' is preceeded by whitespace.", - filepath + ":57: ')' is preceeded by whitespace.", + filepath + ":37:34: '(' is followed by whitespace.", + filepath + ":39:42: '(' is followed by whitespace.", + filepath + ":39:57: ')' is preceeded by whitespace.", + filepath + ":43:14: ')' is preceeded by whitespace.", + filepath + ":51:34: '(' is followed by whitespace.", + filepath + ":53:42: '(' is followed by whitespace.", + filepath + ":53:57: ')' is preceeded by whitespace.", + filepath + ":57:14: ')' is preceeded by whitespace.", }; verify(c, filepath, expected); } @@ -659,14 +659,14 @@ public class CheckerTest assertNotNull(c); final String[] expected = { packageHtmlPath + ":0: missing package documentation file.", - filepath + ":37: '(' is followed by whitespace.", - filepath + ":39: '(' is followed by whitespace.", - filepath + ":39: ')' is preceeded by whitespace.", - filepath + ":43: ')' is preceeded by whitespace.", - filepath + ":51: '(' is followed by whitespace.", - filepath + ":53: '(' is followed by whitespace.", - filepath + ":53: ')' is preceeded by whitespace.", - filepath + ":57: ')' is preceeded by whitespace.", + filepath + ":37:34: '(' is followed by whitespace.", + filepath + ":39:42: '(' is followed by whitespace.", + filepath + ":39:57: ')' is preceeded by whitespace.", + filepath + ":43:14: ')' is preceeded by whitespace.", + filepath + ":51:34: '(' is followed by whitespace.", + filepath + ":53:42: '(' is followed by whitespace.", + filepath + ":53:57: ')' is preceeded by whitespace.", + filepath + ":57:14: ')' is preceeded by whitespace.", }; verify(c, filepath, expected); }