diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java index fd592c307..662d82143 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java @@ -38,8 +38,11 @@ public enum LineSeparatorOption { /** Unix-style line separators. **/ LF("\n"), - /** Matches CR, LF and CRLF line separators. **/ - LF_CR_CRLF("##"), // only the length is used - the actual value is ignored + /** + * Matches CR, LF and CRLF line separators. + * Only the length is used - the actual value is ignored. + */ + LF_CR_CRLF("##"), /** System default line separators. **/ SYSTEM(System.getProperty("line.separator")); diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java index 86ef29968..22263e5c6 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java @@ -47,7 +47,8 @@ public class CheckerTest { final DebugFilter filter = new DebugFilter(); checker.addFilter(filter); - checker.destroy(); // should remove al listeners and filters + // should remove al listeners and filters + checker.destroy(); // Let's try fire some events checker.fireAuditStarted(); @@ -178,7 +179,9 @@ public class CheckerTest { final String[] fileExtensions = {"java", "xml", "properties"}; checker.setFileExtensions(fileExtensions); final int counter = checker.process(files); - assertEquals(1, counter); // comparing to 1 as there is only one legal file in input + + // comparing to 1 as there is only one legal file in input + assertEquals(1, counter); } @SuppressWarnings("deprecation") diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java index b92c8e8c5..c9f36a490 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java @@ -50,7 +50,8 @@ public class ScopeTest { assertEquals("public", o.toString()); assertEquals("public", o.getName()); - Scope.getInstance("unknown"); // will fail + // will fail + Scope.getInstance("unknown"); } @Test diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java index fdc9ef988..7a542e090 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java @@ -49,7 +49,8 @@ public class SeverityLevelTest { assertEquals("info", o.toString()); assertEquals("info", o.getName()); - SeverityLevel.getInstance("unknown"); // will fail + // will fail + SeverityLevel.getInstance("unknown"); } @Test diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportTest.java index 53566f432..b6ffd3337 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportTest.java @@ -97,8 +97,10 @@ public class AvoidStaticImportTest throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(AvoidStaticImportCheck.class); + + // should NOT mask anything checkConfig.addAttribute( - "excludes", //should NOT mask anything + "excludes", "java.io.File.listRoots.listRoots, javax.swing.WindowConstants, javax.swing.*," + "sun.net.ftpclient.FtpClient.*FtpClient, sun.net.ftpclient.FtpClientjunk, java.io.File.listRootsmorejunk"); final String[] expected = { @@ -118,8 +120,10 @@ public class AvoidStaticImportTest throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(AvoidStaticImportCheck.class); + + // should mask com.puppycrawl.tools.checkstyle.imports.InputAvoidStaticImportNestedClass.InnerClass.one checkConfig.addAttribute( - "excludes", //should mask com.puppycrawl.tools.checkstyle.imports.InputAvoidStaticImportNestedClass.InnerClass.one + "excludes", "com.puppycrawl.tools.checkstyle.imports.InputAvoidStaticImportNestedClass.InnerClass.*"); final String[] expected = { "23: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckTest.java index 4f6292187..ac4169ffb 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckTest.java @@ -458,7 +458,9 @@ public class CustomImportOrderCheckTest extends BaseCheckTestSupport { public void testUnsupportedRule() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(CustomImportOrderCheck.class); - checkConfig.addAttribute("customImportOrderRules", "SAME_PACKAGE(3)###UNSUPPORTED_RULE"); //#AAA##BBBB###CCCC####DDDD + + // #AAA##BBBB###CCCC####DDDD + checkConfig.addAttribute("customImportOrderRules", "SAME_PACKAGE(3)###UNSUPPORTED_RULE"); checkConfig.addAttribute("sortImportsInGroupAlphabetically", "true"); final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java index 3d1fae8fa..bdb378def 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java @@ -83,7 +83,9 @@ public class MethodNameCheckTest public void testMethodEqClassAllow() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(MethodNameCheck.class); - checkConfig.addAttribute("allowClassName", "true"); //allow method names and class names to equal + + // allow method names and class names to equal + checkConfig.addAttribute("allowClassName", "true"); final String pattern = "^[a-z][a-zA-Z0-9]*$"; @@ -104,8 +106,12 @@ public class MethodNameCheckTest public void testAccessTuning() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(MethodNameCheck.class); - checkConfig.addAttribute("allowClassName", "true"); //allow method names and class names to equal - checkConfig.addAttribute("applyToPrivate", "false"); //allow method names and class names to equal + + // allow method names and class names to equal + checkConfig.addAttribute("allowClassName", "true"); + + // allow method names and class names to equal + checkConfig.addAttribute("applyToPrivate", "false"); final String pattern = "^[a-z][a-zA-Z0-9]*$"; diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java index 3fef3992c..e8e6f0ac8 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java @@ -62,7 +62,10 @@ public class StaticVariableNameCheckTest final DefaultConfiguration checkConfig = createCheckConfig(StaticVariableNameCheck.class); checkConfig.addAttribute("format", "^s[A-Z][a-zA-Z0-9]*$"); - checkConfig.addAttribute("applyToPrivate", "false"); // allow method names and class names to equal + + // allow method names and class names to equal + checkConfig.addAttribute("applyToPrivate", "false"); + final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputSimple.java"), expected); }