Skip to content

Commit

Permalink
Issue #12017: Kill surviving mutations in AutomaticBean related to tr…
Browse files Browse the repository at this point in the history
…imming strings
  • Loading branch information
Vyom-Yadav authored and nrmancuso committed Aug 6, 2022
1 parent 696cd88 commit 3080013
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
18 changes: 0 additions & 18 deletions .ci/pitest-suppressions/pitest-api-suppressions.xml
Expand Up @@ -36,24 +36,6 @@
<lineContent>severityLevel = SeverityLevel.getInstance(severity);</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>AutomaticBean.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.api.AutomaticBean$RelaxedAccessModifierArrayConverter</mutatedClass>
<mutatedMethod>convert</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to java/lang/String::trim with receiver</description>
<lineContent>result.add(AccessModifierOption.getInstance(token.trim()));</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>AutomaticBean.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.api.AutomaticBean$RelaxedAccessModifierArrayConverter</mutatedClass>
<mutatedMethod>convert</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to java/lang/String::trim with receiver</description>
<lineContent>value.toString().trim(), COMMA_SEPARATOR);</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>AutomaticBean.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.api.AutomaticBean$RelaxedStringArrayConverter</mutatedClass>
Expand Down
Expand Up @@ -391,12 +391,12 @@ private static class RelaxedAccessModifierArrayConverter implements Converter {
public Object convert(Class type, Object value) {
// Converts to a String and trims it for the tokenizer.
final StringTokenizer tokenizer = new StringTokenizer(
value.toString().trim(), COMMA_SEPARATOR);
value.toString(), COMMA_SEPARATOR);
final List<AccessModifierOption> result = new ArrayList<>();

while (tokenizer.hasMoreTokens()) {
final String token = tokenizer.nextToken();
result.add(AccessModifierOption.getInstance(token.trim()));
result.add(AccessModifierOption.getInstance(token));

This comment has been minimized.

Copy link
@nrmancuso

nrmancuso Nov 23, 2022

Member
}

return result.toArray(EMPTY_MODIFIER_ARRAY);
Expand Down

0 comments on commit 3080013

Please sign in to comment.