Skip to content

Commit

Permalink
Issue checkstyle#6320: added REMOVE_CONDITIONALS mutator for sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach committed Dec 28, 2018
1 parent e1ad26b commit 8987dfe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2390,6 +2390,7 @@
<mutator>INVERT_NEGS</mutator>
<mutator>MATH</mutator>
<mutator>NEGATE_CONDITIONALS</mutator>
<mutator>REMOVE_CONDITIONALS</mutator>
<mutator>RETURN_VALS</mutator>
<mutator>TRUE_RETURNS</mutator>
<mutator>VOID_METHOD_CALLS</mutator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void shouldLogActualParameterNumber()
}

@Test
public void shouldIgnoreMethodsWithOverrideAnnotation()
public void testIgnoreOverriddenMethods()
throws Exception {
final DefaultConfiguration checkConfig =
createModuleConfig(ParameterNumberCheck.class);
Expand All @@ -117,4 +117,18 @@ public void shouldIgnoreMethodsWithOverrideAnnotation()
verify(checkConfig, getPath("InputParameterNumber.java"), expected);
}

@Test
public void testIgnoreOverriddenMethodsFalse()
throws Exception {
final DefaultConfiguration checkConfig =
createModuleConfig(ParameterNumberCheck.class);
final String[] expected = {
"6:10: " + getCheckMessage(MSG_KEY, 7, 8),
"11:10: " + getCheckMessage(MSG_KEY, 7, 8),
"19:10: " + getCheckMessage(MSG_KEY, 7, 8),
"24:10: " + getCheckMessage(MSG_KEY, 7, 8),
};
verify(checkConfig, getPath("InputParameterNumber.java"), expected);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,8 @@ public void run() {

/** Empty constructor */
public InputExecutableStatementCount(String someString) {}

static Runnable r1 = () -> {
String.valueOf("Hello world one!");
};
}

0 comments on commit 8987dfe

Please sign in to comment.