Skip to content

Commit

Permalink
Issue #12326: Resolve Pitest suppression for AccessModifierOption
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatSneakyCoder committed Nov 20, 2022
1 parent 1cd0b57 commit 9ebf025
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
9 changes: 0 additions & 9 deletions .ci/pitest-suppressions/pitest-naming-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@
<lineContent>curNode = curNode.getNextSibling();</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>AccessModifierOption.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.naming.AccessModifierOption</mutatedClass>
<mutatedMethod>getInstance</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to java/lang/String::trim with receiver</description>
<lineContent>return valueOf(AccessModifierOption.class, modifierName.trim().toUpperCase(Locale.ENGLISH));</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>ParameterNameCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck</mutatedClass>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ public void testScopeInnerInterfacesPublic() throws Exception {
getPath("InputJavadocMethodScopeInnerInterfaces.java"), expected);
}

@Test
public void testTrimProperty() throws Exception {
final String[] expected = {
"27: " + getCheckMessage(MSG_RETURN_EXPECTED),
};
verifyWithInlineConfigParser(
getPath("InputJavadocMethodAccessModifier.java"), expected);
}

@Test
public void testScopeAnonInnerPrivate() throws Exception {
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
JavadocMethod
allowedAnnotations = (default)Override
validateThrows = (default)false
accessModifiers = \tpublic
allowMissingParamTags = (default)false
allowMissingReturnTag = (default)false
tokens = (default)METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF
*/

package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocmethod;

public class InputJavadocMethodAccessModifier {
class classOne {

}

class classTwo {

}

/**
* @return
*/
public String method1() { // violation '@return tag should be present and have description'
return "arbitrary_string";
}
}

0 comments on commit 9ebf025

Please sign in to comment.