Skip to content

Commit

Permalink
Issue checkstyle#13809: kill mutation for JavadocPropertiesGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin222004 committed Oct 4, 2023
1 parent a7fa83a commit 160e8e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 118 deletions.
117 changes: 0 additions & 117 deletions config/pitest-suppressions/pitest-common-2-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,122 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressedMutations>












































































































<mutation unstable="false">
<sourceFile>JavadocPropertiesGenerator.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.JavadocPropertiesGenerator</mutatedClass>
<mutatedMethod>getFirstJavadocSentence</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/api/DetailAST::getNextSibling</description>
<lineContent>child = child.getNextSibling()) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>JavadocPropertiesGenerator.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.JavadocPropertiesGenerator</mutatedClass>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,11 @@ private static String getName(DetailAST ast) {
*/
private static String getFirstJavadocSentence(DetailAST ast) throws CheckstyleException {
String firstSentence = null;
for (DetailAST child = ast.getFirstChild(); child != null && firstSentence == null;
for (DetailAST child = ast.getFirstChild(); firstSentence == null;
child = child.getNextSibling()) {
if (child == null) {
break;
}
// If there is an annotation, the javadoc comment will be a child of it.
if (child.getType() == TokenTypes.ANNOTATION) {
firstSentence = getFirstJavadocSentence(child);
Expand Down

0 comments on commit 160e8e8

Please sign in to comment.