Skip to content

Commit

Permalink
Issue #6381: Incorrect warning for empty lambda bodies with google_ch…
Browse files Browse the repository at this point in the history
…ecks.xml
  • Loading branch information
fzdy1914 authored and romani committed Feb 20, 2019
1 parent cb46811 commit 88907c5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<suppressions>
<!-- can't split long messages between lines -->
<suppress checks="RegexpSingleline" files="google_checks\.xml" lines="37,77"/>
<suppress checks="RegexpSingleline" files="google_checks\.xml" lines="37,78"/>

<suppress checks="FileLength"
files="TokenTypes.java|IndentationCheckTest.java"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void testWhitespaceAroundBasic() throws Exception {
"150:20: " + getCheckMessage(messages, msgPreceded, ":"),
"249:14: " + getCheckMessage(messages, msgPreceded, "->"),
"250:15: " + getCheckMessage(messages, msgFollowed, "->"),
"250:17: " + getCheckMessage(messages, msgPreceded, "{"),
};

final String filePath = getPath("InputWhitespaceAroundBasic.java");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ class NewGoogleOperators

l = ()-> { }; //warn
l = () ->{ }; //warn
l = () -> { };
l = () -> { }; //ok
l = () -> {}; //ok

java.util.Arrays.sort(null, String :: compareToIgnoreCase);
java.util.Arrays.sort(null, String::compareToIgnoreCase);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/google_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
Expand Down

0 comments on commit 88907c5

Please sign in to comment.