-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #11666: Added LITERAL_CASE support for WhitespaceAfter check
- Loading branch information
1 parent
3ca6f75
commit cddf6a5
Showing
7 changed files
with
71 additions
and
2 deletions.
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
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