forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#12441: Resolve Pitest suppression for RightCurlyCheck
- Loading branch information
Showing
4 changed files
with
77 additions
and
12 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
26 changes: 26 additions & 0 deletions
26
.../com/puppycrawl/tools/checkstyle/checks/blocks/rightcurly/InputRightCurlyTestDefault.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,26 @@ | ||
/* | ||
RightCurly | ||
option = (default)SAME | ||
tokens = (default)LITERAL_TRY , LITERAL_CATCH , LITERAL_FINALLY , LITERAL_IF , LITERAL_ELSE | ||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.blocks.rightcurly; | ||
|
||
public class InputRightCurlyTestDefault { | ||
|
||
public void foo() { | ||
if (456 == 123) { } // OK | ||
if(true) { } else { } // OK | ||
} | ||
|
||
public void foo1() { | ||
if (4 > 0) { | ||
// | ||
} // violation ''}' at column 9 should be on the same line as .*/else' | ||
else { | ||
// | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
.../puppycrawl/tools/checkstyle/checks/blocks/rightcurly/InputRightCurlyTestIfElseAlone.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,32 @@ | ||
/* | ||
RightCurly | ||
option = ALONE | ||
tokens = LITERAL_IF, LITERAL_ELSE | ||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.blocks.rightcurly; | ||
|
||
public class InputRightCurlyTestIfElseAlone { | ||
|
||
public void test() { | ||
int id = 0; | ||
switch (id) { | ||
case 0: break; | ||
case 1: if (1 == 0) { | ||
break; | ||
}; // violation ''}' at column 12 should be alone on a line.' | ||
case 2: break; | ||
} | ||
} | ||
|
||
public void test2() { | ||
if(true) { | ||
|
||
} if(false) { // violation ''}' at column 9 should be alone on a line.' | ||
|
||
} | ||
} | ||
|
||
} |