Issue #13109: Kill mutation for EqualsAvoidNullCheck 3#13126
Closed
Kevin222004 wants to merge 1 commit intocheckstyle:masterfrom
Closed
Issue #13109: Kill mutation for EqualsAvoidNullCheck 3#13126Kevin222004 wants to merge 1 commit intocheckstyle:masterfrom
Kevin222004 wants to merge 1 commit intocheckstyle:masterfrom
Conversation
Contributor
Author
|
GitHub, generate report |
Contributor
|
Report generation failed on phase "make_report", |
Contributor
|
@Kevin222004 looks like GitHub runner ran out of space: https://github.com/checkstyle/checkstyle/actions/runs/5141568905/jobs/9254217315#step:9:5992 |
Contributor
Author
romani
requested changes
Jun 3, 2023
| */ | ||
| public Set<FieldFrame> getChildren() { | ||
| return Collections.unmodifiableSet(children); | ||
| return new HashSet<>(children); |
Member
There was a problem hiding this comment.
I asked this question somewhere.
How ca we instruct pitest to not mutate Collections.unmodifiableSet better to keep code restrictive on mutability, even nobody even tried to change this collection.
Contributor
Author
|
closing this covered at #13127 |
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 EqualsAvoidNullCheck 3
1 check :- https://checkstyle.org/config_coding.html#EqualsAvoidNull
2covering :-
checkstyle/config/pitest-suppressions/pitest-coding-1-suppressions.xml
Lines 30 to 37 in 81448ea
3 Explaination
getChildren method is used only at
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java
Line 336 in 81448ea
ok so as per https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html#unmodifiable:~:text=They%20are%20unmodifiable.%20Elements%20cannot%20be%20added%20or%20removed. we cannot modify children
in above method we are not mdifiying the children in any way,
so removal of it is not creating any issue.
|https://kevin222004.github.io/reports/Ev3/2023-06-01-T-23-12-41/test-report/index.html