Skip to content

Issue #13321: Kill mutation for UncommentedMainCheck-3#13365

Merged
rdiachenko merged 1 commit intocheckstyle:masterfrom
Kevin222004:UMC3
Jul 10, 2023
Merged

Issue #13321: Kill mutation for UncommentedMainCheck-3#13365
rdiachenko merged 1 commit intocheckstyle:masterfrom
Kevin222004:UMC3

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jul 6, 2023

Issue #13321: Kill mutation for UncommentedMainCheck-3


Check

https://checkstyle.org/checks/misc/uncommentedmain.html


Mutation

<mutation unstable="false">
<sourceFile>UncommentedMainCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck</mutatedClass>
<mutatedMethod>beginTree</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable currentClass</description>
<lineContent>currentClass = null;</lineContent>
</mutation>


Explaination

In visitToken when Token is classDEF or RecordDef it call visitClassOrRecordDef where if classDepth == 0 then only currentClass will update know every time when new file come sequentially they alwyas have a class and that time the classDepth is always 0. and classdepth is reset to 0 in begintree.


Regression


Diff Regression config: https://gist.githubusercontent.com/Kevin222004/92e6545d9dda7c3febcd4ad8f8a91443/raw/5b88dc50b3b7828cca1bce0d4d6aa47209d25647/UMC.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

github-actions bot commented Jul 6, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 6, 2023

@romani
Copy link
Copy Markdown
Member

romani commented Jul 7, 2023

new file come sequentially they alwyas have a class

New file can have only interface or record. Are you sure in your explanation?

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.

After reading a code, I agree on this update

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 rdiachenko and unassigned Vyom-Yadav Jul 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

@rdiachenko rdiachenko merged commit 14dbe32 into checkstyle:master Jul 10, 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