diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java index 47c24d3e6..b0f7495f2 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java @@ -192,8 +192,11 @@ class Verifier " characters"); } - if (!mConfig.isAllowTabs() && (mLines[i].indexOf('\t') != -1)) { - log(i + 1, "line contains a tab character"); + if (!mConfig.isAllowTabs()) { + final int tabPosition = mLines[i].indexOf('\t'); + if (tabPosition != -1) { + log(i + 1, tabPosition, "line contains a tab character"); + } } } diff --git a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java index 316103527..3f44b7c7e 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java @@ -377,7 +377,7 @@ public class CheckerTest filepath + ":1: file length is 146 lines (max allowed is 20).", filepath + ":3: Line does not match expected header line of '// Created: 2001'.", filepath + ":18: line longer than 80 characters", - filepath + ":19: line contains a tab character", + filepath + ":19:25: line contains a tab character", filepath + ":25:29: variable 'badConstant' must match pattern '^[A-Z](_?[A-Z0-9]+)*$'.", filepath + ":30:24: variable 'badStatic' must match pattern '^s[A-Z][a-zA-Z0-9]*$'.", filepath + ":35:17: variable 'badMember' must match pattern '^m[A-Z][a-zA-Z0-9]*$'.",