Skip to content

Issue #13501: Kill mutation for AbstarctHeaderCheck#13269

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:ABC3
Aug 6, 2023
Merged

Issue #13501: Kill mutation for AbstarctHeaderCheck#13269
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:ABC3

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jun 20, 2023

Issue #13501: Kill mutation for AbstarctHeaderCheck


Check

https://checkstyle.org/config_header.html


Mutation

<mutation unstable="false">
<sourceFile>AbstractHeaderCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to java/nio/charset/Charset::name</description>
<lineContent>StandardCharsets.UTF_8.name()));</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>AbstractHeaderCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck::createCharset</description>
<lineContent>private Charset charset = createCharset(System.getProperty(&quot;file.encoding&quot;,</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>AbstractHeaderCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.ArgumentPropagationMutator</mutator>
<description>replaced call to java/lang/System::getProperty with argument</description>
<lineContent>private Charset charset = createCharset(System.getProperty(&quot;file.encoding&quot;,</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>AbstractHeaderCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable charset</description>
<lineContent>private Charset charset = createCharset(System.getProperty(&quot;file.encoding&quot;,</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>AbstractHeaderCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck</mutatedClass>
<mutatedMethod>setCharset</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable charset</description>
<lineContent>this.charset = createCharset(charset);</lineContent>
</mutation>


Explaination

at #13268, specific message #13268 (comment)

@Kevin222004 Kevin222004 changed the title Issue #13109: Kill mutation for AbstarctHeaderCheck Issue #13328: Kill mutation for AbstarctHeaderCheck Jun 30, 2023
@romani
Copy link
Copy Markdown
Member

romani commented Jul 31, 2023

@Kevin222004 , is this duplicate PR of #13268

Can we close it ?

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Kevin222004 commented Jul 31, 2023

@romani Yes it is created for discussion purpose
#13269 (comment)

after #13268 (comment) I am closing that
and update this in few hours and mark for review

after fixing spotbug

@romani
Copy link
Copy Markdown
Member

romani commented Jul 31, 2023

Please add suppression for Checker with same comment above https://github.com/checkstyle/checkstyle/actions/runs/5714370827/job/15481588407?pr=13269#step:6:1658
Please also mention that it is conflict with pitest but value pitest above checker.

@Kevin222004
Copy link
Copy Markdown
Contributor Author

@romani #13269 (comment) done

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.

Items:

@Kevin222004 Kevin222004 changed the title Issue #13328: Kill mutation for AbstarctHeaderCheck Issue #13501: Kill mutation for AbstarctHeaderCheck Aug 2, 2023
@Kevin222004 Kevin222004 force-pushed the ABC3 branch 3 times, most recently from 199b379 to 856e522 Compare August 3, 2023 16:54
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.

Last:

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

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! @Kevin222004 @romani I think we discussed creating an issue about removing file.encoding

@Vyom-Yadav Vyom-Yadav assigned rdiachenko and unassigned Vyom-Yadav Aug 4, 2023
@Vyom-Yadav Vyom-Yadav requested a review from rdiachenko August 4, 2023 05:56
@romani
Copy link
Copy Markdown
Member

romani commented Aug 4, 2023

After deeper analysis, I recalled it, it is not required, this property is not effective at all. It remnants of something old.

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
Copy link
Copy Markdown
Member

rebased

@romani romani merged commit c4f8052 into checkstyle:master Aug 6, 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