forked from checkstyle/checkstyle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#11666: Added LITERAL_CASE support for WhitespaceAfte…
…r check
- Loading branch information
1 parent
1f81858
commit d66d803
Showing
6 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...l/tools/checkstyle/checks/whitespace/whitespaceafter/InputWhitespaceAfterLiteralCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
WhitespaceAfter | ||
tokens = LITERAL_CASE | ||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.whitespace.whitespaceafter; | ||
|
||
public class InputWhitespaceAfterLiteralCase { | ||
public static void main(String... args) { | ||
switch(args[0]) { | ||
case "123": // OK | ||
return; | ||
case"1": // violation ''case' is not followed by whitespace' | ||
return; | ||
default: | ||
return; | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
.../tools/checkstyle/checks/whitespace/whitespaceafter/InputWhitespaceAfterLiteralCase2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
WhitespaceAfter | ||
tokens = LITERAL_CASE | ||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.whitespace.whitespaceafter; | ||
|
||
public class InputWhitespaceAfterLiteralCase2 { | ||
public static void main(String... args) { | ||
switch(args[0]) { | ||
case"123": // violation ''case' is not followed by whitespace' | ||
return; | ||
case "1": // OK | ||
return; | ||
default: | ||
return; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters