Skip to content

Issue #13321: Kill mutation for DetectorOption#13412

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:do1
Aug 9, 2023
Merged

Issue #13321: Kill mutation for DetectorOption#13412
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:do1

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jul 20, 2023

Issue #13321: Kill mutation for DetectorOption


Mutation

<mutation unstable="false">
<sourceFile>DetectorOptions.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.regexp.DetectorOptions</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable message</description>
<lineContent>private String message = &quot;&quot;;</lineContent>
</mutation>


Explaination

It is some inner class, and all fields already not initialized, so with such update we do implementation consistent.

All the time whenever we use this message field in check we use the build method and the build method is

public DetectorOptions build() {
message = Optional.ofNullable(message).orElse("");
suppressor = Optional.ofNullable(suppressor).orElse(NeverSuppress.INSTANCE);
pattern = Optional.ofNullable(format).map(this::createPattern).orElse(null);
return DetectorOptions.this;

message is set like message = Optional.ofNullable(message).orElse(""); so if the message is null then it will be "" empty string so removal will not make issue


Regression :-


Diff Regression config: https://gist.githubusercontent.com/Kevin222004/af6965cd82853221b89f6ba3b81b996a/raw/89f2f0efe08703af1c3c9b9f3b5d2330a064dea3/RegexpSingleline.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: Regression-2

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

Report generation failed on phase "make_report",
step "Generate report".
Link: https://github.com/checkstyle/checkstyle/actions/runs/5607849454

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

Report generation failed on phase "make_report",
step "Generate report".
Link: https://github.com/checkstyle/checkstyle/actions/runs/5610322336

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

Report generation failed on phase "make_report",
step "Generate report".
Link: https://github.com/checkstyle/checkstyle/actions/runs/5623832787

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

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

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:

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 a review from Vyom-Yadav August 9, 2023 00:30
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 Aug 9, 2023
@romani romani merged commit 805fa20 into checkstyle:master Aug 9, 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