Issue #13321: Kill mutation for BlockCommentPosition 2#13424
Issue #13321: Kill mutation for BlockCommentPosition 2#13424rnveach merged 1 commit intocheckstyle:masterfrom
Conversation
|
Github, generate report for config: |
|
Github, generate report |
|
Github, generate report |
|
Github, generate report |
|
Github, generate report |
|
Github, generate report |
| * @return true if block comment is on specified token without modifiers | ||
| */ | ||
| private static boolean isOnPlainClassMember(DetailAST blockComment, int memberType) { | ||
| private static boolean isOnPlainClassMember(DetailAST blockComment) { |
There was a problem hiding this comment.
Javadoc of this method:
/**
* Checks that block comment is on specified class member without any modif
It is even strange why we need such javadoc in their most simplistic form.
We should support javadoc at any location.
There was a problem hiding this comment.
https://checkstyle.org/checks/javadoc/invalidjavadocposition.html
Javadocs are not valid at every location.
There was a problem hiding this comment.
such methods just used throught isOnMember in
and this method is used in InvalidJavadocPositionCheck and all other Checks that are used in "Diff Regression config".
There was a problem hiding this comment.
It also more importantly used to identify if we should process the comment as a javadoc and pass it to the javadoc checks.
This is an important area for us.
There was a problem hiding this comment.
Checks that block comment is on specified class member without any modifiers.
please change to Checks that block comment is above all elements of class members.
and this brings that we can try to kill it by javadoc comment on static block or any other
that are not referenced at
:
class A {
/** some */
{ }
}
There was a problem hiding this comment.
but this:
$ git diff
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/utils/blockcommentposition/InputBlockCommentPositionOnClass.java b/src/test/resources/com/puppycrawl/tools/checkstyle/utils/blockcommentposition/InputBlockCommentPositionOnClass.java
index 69f4877..dd2ff05 100644
--- a/src/test/resources/com/puppycrawl/tools/checkstyle/utils/blockcommentposition/InputBlockCommentPositionOnClass.java
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/utils/blockcommentposition/InputBlockCommentPositionOnClass.java
@@ -4,6 +4,8 @@ package com.puppycrawl.tools.checkstyle.utils.blockcommentposition;
* I'm a javadoc
*/
public class InputBlockCommentPositionOnClass {
+ /** some */
+ { }
}
is not killing mutation.
There was a problem hiding this comment.
this two conditons are enough for this method that test javadoc on class member:
&& !parent.getPreviousSibling().hasChildren()
&& parent.getParent().getParent().getType() == TokenTypes.OBJBLOCK;
if we make javadoc on non Method or Field .....:
public static boolean isOnMember(DetailAST blockComment) {
return isOnMethod(blockComment)
|| isOnField(blockComment)
|| isOnConstructor(blockComment)
|| isOnEnumConstant(blockComment)
|| isOnAnnotationField(blockComment)
|| isOnCompactConstructor(blockComment);
}
can it be nested class?
There was a problem hiding this comment.
nested class is not plain member, it is not affecting mutation.
|
I am supporting removal of this condition. Let make PR ready for review |
|
Github, generate report |
|
it is not a regresson: moved to #14022 |
Issue #13321: Kill mutation for BlockCommentPosition 2
Mutations
checkstyle/config/pitest-suppressions/pitest-utils-suppressions.xml
Lines 21 to 28 in 8804126
Explaination
dependency tree on this method
so modules:
all ast based javadoc checks (MissingDeprecatedCheck, AtclauseOrderCheck, JavadocBlockTagLocationCheck, JavadocMissingLeadingAsteriskCheck, JavadocMissingWhitespaceAfterAsteriskCheck, JavadocParagraphCheck, JavadocTagContinuationIndentationCheck, NonEmptyAtclauseDescriptionCheck, RequireEmptyLineBeforeBlockTagGroupCheck, SingleLineJavadocCheck, SummaryJavadocCheck)
InvalidJavadocPositionCheck
DesignForExtensionCheck
MissingJavadocPackageCheck
JavadocContentLocationCheck
we can reuse https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/checks-only-javadoc-error.xml
Regression
Diff Regression config: https://gist.githubusercontent.com/romani/c02d1cfd4005bdd25a4a1c9d0e5ec09c/raw/235d6dd039b9b3ee0c01afce35be1771af3ecb55/pull-13424-regression-config.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/21e3934e85f802e2fbd48af06d122364/raw/604256badd733d8568064f371d55657c04b00dfd/test-projects-2.properties
Report label: Final-Report-2