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#3546: add lambda in a rightcurlycheck
- Loading branch information
Showing
4 changed files
with
122 additions
and
11 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
29 changes: 29 additions & 0 deletions
29
...resources/com/puppycrawl/tools/checkstyle/checks/blocks/InputRightCurlyAloneInLambda.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,29 @@ | ||
package com.puppycrawl.tools.checkstyle.checks.blocks; | ||
|
||
/* | ||
This is test class for token LAMBDA. | ||
*/ | ||
public class InputRightCurlyAloneInLambda { | ||
|
||
static Runnable r1 = () -> { | ||
String.valueOf("Test rightCurly one!"); | ||
}; | ||
|
||
static Runnable r2 = () -> String.valueOf("Test rightCurly two!"); | ||
|
||
static Runnable r3 = () -> {String.valueOf("Test rightCurly two!");}; //violation | ||
|
||
static Runnable r4 = () -> { | ||
String.valueOf("Test rightCurly two!");}; //violation | ||
|
||
static Runnable r5 = () -> | ||
{ | ||
String.valueOf("Test rightCurly four!"); | ||
}; | ||
|
||
static Runnable r6 = () -> {}; | ||
|
||
static Runnable r7 = () -> | ||
{ | ||
}; | ||
} |
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