Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #12251: Resolve Pitest suppression for AbstractParenPadCheck #12258

Merged
merged 1 commit into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions .ci/pitest-suppressions/pitest-whitespace-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@
<lineContent>option = PadOption.valueOf(optionStr.trim().toUpperCase(Locale.ENGLISH));</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>AbstractParenPadCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck</mutatedClass>
<mutatedMethod>setOption</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to java/lang/String::trim with receiver</description>
<lineContent>option = PadOption.valueOf(optionStr.trim().toUpperCase(Locale.ENGLISH));</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>EmptyForInitializerPadCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck</mutatedClass>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ public void test1322879() throws Exception {
expected);
}

@Test
public void testTrimOptionProperty() throws Exception {
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(
getPath("InputParenPadToCheckTrimFunctionInOptionProperty.java"),
expected);
}

@Test
public void testNospaceWithComplexInput() throws Exception {
final String[] expected = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
ParenPad
option = \tSPACE
tokens = (default)ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, \
ENUM_CONSTANT_DEF, EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, \
LITERAL_NEW, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL, \
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA, RECORD_DEF


*/

package com.puppycrawl.tools.checkstyle.checks.whitespace.parenpad;

public class InputParenPadToCheckTrimFunctionInOptionProperty {

public InputParenPadToCheckTrimFunctionInOptionProperty ( int i ) // ok
{
this ();
toString ();
}
protected InputParenPadToCheckTrimFunctionInOptionProperty ()
{
super ();
}

public void enhancedFor ()
{
int[] i = new int[2];
for ( int j: i ) { // ok
System.identityHashCode ( j );
}
}
}