Issue #13328: Kill mutation for EqualsAvoidNullCheck 4#13127
Issue #13328: Kill mutation for EqualsAvoidNullCheck 4#13127rdiachenko merged 1 commit intocheckstyle:masterfrom
Conversation
|
GitHub, generate report |
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java
Outdated
Show resolved
Hide resolved
pom.xml
Outdated
| <param>com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheckTest</param> | ||
| </targetTests> | ||
| <avoidCallsTo> | ||
| <avoidCallsTo>java.util.Collections</avoidCallsTo> |
There was a problem hiding this comment.
This is too broad exclusion.
Can we narrow to Collections.unmodifiableSet ?
There was a problem hiding this comment.
If there is no way , please prove it .
Absolutely last resort: we can wrap such method in checkstyle util method and exclude by our class.
There was a problem hiding this comment.
Can we narrow to Collections.unmodifiableSet ?
no
If there is no way , please prove it .
the documentation says that https://pitest.org/quickstart/maven/#:~:text=List%20of%20packages%20and%20classes%20which%20are%20to%20be%20considered%20outside%20the%20scope%20of%20mutation.%20Any%20lines%20of%20code%20containing%20calls%20to%20these%20classes%20will%20not%20be%20mutated. classes will not mutate hence it is not mentioned about a particular method anywhere.
Apart of this i have report only https://kevin222004.github.io/Regression/com.puppycrawl.tools.checkstyle.checks.coding/EqualsAvoidNullCheck.java.html
There was a problem hiding this comment.
Absolutely last resort: we can wrap such method in checkstyle util method and exclude by our class.
I am not getting you on this, if we will create and call such kind of method we have to pass the parameter and hence it is not making any difference right know with Collections.unmodifiableSet so it will also not make any impact withour new mwthod as well it will again a pit failure as a argument propagation one
There was a problem hiding this comment.
Create class in our project with name UnmodifableCollectionUtil
Make method
unmodifiableSet(collection){
return Collections.unmodifiableSet(collection);
}
Add javadoc to this class to explain reason of wrapping of jdk method.
Add our class to pitest config for no mutation.
There was a problem hiding this comment.
Please ALWAYS share links to what is done.
There was a problem hiding this comment.
Actually I have posted on mailing list which is not public if they reply then it will visible but i will share on their issue by today
There was a problem hiding this comment.
That is why better to open ticket on GitHub. In worse case they will close it won't fix. It gives all others from world to participate and support idea
There was a problem hiding this comment.
That is why better to open ticket on GitHub. In worse case they will close it won't fix. It gives all others from world to participate and support idea
Yes, from next time will take care of this
I have opened an issue hcoles/pitest#1233
90fdba2 to
db22771
Compare
src/main/java/com/puppycrawl/tools/checkstyle/utils/UnmodifiableCollectionUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/utils/UnmodifiableCollectionUtil.java
Outdated
Show resolved
Hide resolved
src/test/java/com/puppycrawl/tools/checkstyle/utils/UnmodifiableCollectionUtilTest.java
Outdated
Show resolved
Hide resolved
|
There is conflict, and waiting for input test |
To be honest I have given a time to create a input based test but I really don't find anything so i have leaved as it is. I will give once again time and try to find something |
|
@romani please start reviewing other pull request they are ready ci failures are not related to changes |
|
@romani if you don't have any issue can I Suppress the UnmodifableCollectionUtil class from the util profile as well. |
|
Please resolve conflict |
1e6340f to
15f39c6
Compare
|
@romani I have updated the branch with input based testing but i have suppress our new class from util profile |
src/test/java/com/puppycrawl/tools/checkstyle/utils/UnmodifiableCollectionUtilTest.java
Outdated
Show resolved
Hide resolved
25c6765 to
6d7aa1e
Compare
d061dd2 to
0d1907c
Compare
|
I still don't see answers to my questions. |
d68eff0 to
523b263
Compare
|
@Kevin222004 , please update linkcheck suppression file. |
Issue #13328: Kill mutation for EqualsAvoidNullCheck 4
covering
checkstyle/config/pitest-suppressions/pitest-coding-1-suppressions.xml
Lines 39 to 46 in 81448ea