pitest icon indicating copy to clipboard operation
pitest copied to clipboard

MemberVariableMutator removes assignments to final members

Open Vampire opened this issue 5 years ago • 1 comments

Should the MemberVariableMutator remove assignments to final members? This code would never compile actually, so noone could actually introduce this error. Replacing the assignment by a different assignment would make sense, but this is already handled by other mutators I think.

Vampire avatar Sep 02 '19 18:09 Vampire

Especially removing the assignment of null in certain constructor parts to a final variable is not killable. While it would not compile, the bytecode is valid but the variable is still null, so from the tests perspective, at least removing a null assignment to a final variable makes no sense at all.

Vampire avatar May 30 '23 22:05 Vampire