Skip to content

Issue #13501: Kill mutation for CommonUtil-2#13475

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

Issue #13501: Kill mutation for CommonUtil-2#13475
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:cu2

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jul 27, 2023

Issue #13501: Kill mutation for CommonUtil-2


Mutation

<mutation unstable="false">
<sourceFile>CommonUtil.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.utils.CommonUtil</mutatedClass>
<mutatedMethod>isName</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to java/lang/String::isEmpty</description>
<lineContent>boolean isName = !str.isEmpty();</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>CommonUtil.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.utils.CommonUtil</mutatedClass>
<mutatedMethod>isName</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>boolean isName = !str.isEmpty();</lineContent>
</mutation>


Explaination

This method is used in

public final void setExcludedPackages(String... excludedPackages) {
final List<String> invalidIdentifiers = Arrays.stream(excludedPackages)
.filter(Predicate.not(CommonUtil::isName))

This method is used to set the property excludedPackages lets suppose if it is set empty then in filter commonUtil.isName never be call so the string never be empty it always true


Diff Regression config: https://gist.githubusercontent.com/Kevin222004/ccd588c72cd541ff98736f08dc687e43/raw/28c14aa0fdf848a5191761ffe4cbbea8c860a0a9/gist.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: New-Regression-2

@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

Copy link
Copy Markdown
Contributor

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

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

Item:

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@Kevin222004 Kevin222004 changed the title Issue #13321: Kill mutation for CommonUtil-2 Issue #13501: Kill mutation for CommonUtil-2 Aug 7, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 7, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

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 if ci and reports are good

@romani romani assigned nrmancuso and unassigned romani Aug 7, 2023
@romani romani requested review from Vyom-Yadav and rdiachenko August 7, 2023 14:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 7, 2023

@nrmancuso nrmancuso assigned Vyom-Yadav and unassigned nrmancuso Aug 8, 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

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 3dc2cad 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.

5 participants