-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unreachable Mutant, ENUM::lambda$static$0 #1273
Comments
Thanks for the report and the reproducable sample. The problem is that this is a mutation called only from static initialization code. This means the code is exectued only once per jvm and causes multiple problems for mutation testing (theres an entry on this in the FAQ which I can't link to as I seem to have cunningly include no anchors in the page). Pitest avoids mutating code in static initializers and tries to avoid mutating code called only from static initializers. The filtering doesn't seem to be working in this case, probably because the code predates lambdas and hasn't been updated. |
The analysis was indeed failing to consider invokeDynamic calls. A fix has been merged and will be in the next release. Thanks again for the high quality bug report. |
I've encountered a mutant that I wasn't able to remove in a Java 17 code base using PITest (1.15.0) in conjunction with JUnit5 (5.9.3) test cases. The code is a bit niche and poorly written but I managed to recreate it in this repository.
Details
The mutant lives at this line:
https://github.com/Shawn-Armstrong/mutation_case/blob/0fc16a8e8d0f8a2a883898e9aa4ea2759c27abc4/app/src/main/java/myjavaproject2/Toto.java#L19
The report indicated the following mutation:
The full report can be viewed here.
I suspect this might have something to do with low level details related the JVM / compiler and how it instantiates
ENUM
andstatic final
fields.The text was updated successfully, but these errors were encountered: