Skip to content

Issue #13321: Kill mutation for RegexpCheck-2#13381

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:regexp2
Jul 16, 2023
Merged

Issue #13321: Kill mutation for RegexpCheck-2#13381
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:regexp2

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jul 8, 2023

Issue #13321: Kill mutation for RegexpCheck-2


check

https://checkstyle.org/checks/regexp/regexpsinglelinejava.html#RegexpSinglelineJava
https://checkstyle.org/checks/regexp/regexpsingleline.html#RegexpSingleline


Mutation

<mutation unstable="false">
<sourceFile>RegexpSinglelineCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck</mutatedClass>
<mutatedMethod>beginProcessing</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions$Builder::compileFlags with receiver</description>
<lineContent>.compileFlags(0)</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>RegexpSinglelineJavaCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck</mutatedClass>
<mutatedMethod>beginTree</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions$Builder::compileFlags with receiver</description>
<lineContent>.compileFlags(0)</lineContent>
</mutation>

@Kevin222004
Copy link
Copy Markdown
Contributor Author

@romani can you give some guidance here
I tried to find it but i don't understand what does this do exactly

@romani
Copy link
Copy Markdown
Member

romani commented Jul 9, 2023

https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#compile-java.lang.String-int-

Zero is default, https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/19fb8f93c59dfd791f62d41f332db9e306bc1422/src/java.base/share/classes/java/util/regex/Pattern.java#L1068 we do not need to explicitly set it.

This is bad side of pitest fanatizm, code is more explicit and doesn't require user to know or remember default implementations.

I am still ok to merge it, as it is in Builder pattern.

Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge

@romani romani requested review from Vyom-Yadav and rdiachenko July 9, 2023 13:29
@romani romani assigned Vyom-Yadav and rdiachenko and unassigned Vyom-Yadav Jul 9, 2023
Copy link
Copy Markdown
Member

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rdiachenko rdiachenko assigned Vyom-Yadav and unassigned rdiachenko Jul 10, 2023
Copy link
Copy Markdown
Member

@Vyom-Yadav Vyom-Yadav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Vyom-Yadav Vyom-Yadav assigned romani and unassigned Vyom-Yadav Jul 16, 2023
@romani romani merged commit e3d8c85 into checkstyle:master Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants