Issue #13109: Kill mutation for FileText 2#13158
Merged
romani merged 1 commit intocheckstyle:masterfrom Jun 7, 2023
Merged
Conversation
Contributor
Author
|
How to do regression testing here? |
Contributor
Author
|
ready for review |
Member
|
resolve Checker violation. This class is used by all Checks and Filters, I think this is a case where we do not need diff regression. Green CI is enough. |
Contributor
Author
|
Done |
40 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #13109: Kill mutation for FileText 2
Mutation covered
checkstyle/config/pitest-suppressions/pitest-api-suppressions.xml
Lines 75 to 82 in 82b6ac4
Explaination
Our code is
Here the part of code
is mutated as
Here the condition in if statment is
something like
know if we see logically their is 2 possiblity
either
fileText.lineBreaksisnullor it isnot nullif it is null then the if block willexecute and in the case of
not nullelse will execute.know instead of doing this
fileText.lineBreaks == nullin if block and set the lineBreaks to nullwe can change the if condition to
so the new code look like
Here
lineBreaksset to null which is its default value and this is constructor. so if we remove the default value it won't effect anything.in this case when
fileText.lineBreaks == nullby default it will asignlineBreaks = null;it will not make any effect to code
so finall code we write as