Issue #12587: resolves modifier pitest suppression #12588
Merged
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 #12587
https://checkstyle.org/config_modifier.html#RedundantModifier_Properties
Report: http://rveach.no-ip.org/checkstyle/regression/322/
No differences.
The old code is more a minor speed up in processing time and we don't lose much by removing it.
The method is
processMethods
and the AST given to it is always aMETHOD_DEF
. Usually we go 1 up on this before starting the loop, so it never starts withMETHOD_DEF
. However, even if it does start withMETHOD_DEF
all the cases inside the loop are notMETHOD_DEF
, so it goes straight to the last case which is the same the code we are removing, which is go up 1 parent.Thus, its the same exact processing, except it takes a few more condition checks to realize this. It isn't a big jump in processing time, so I am ok to just remove the impacted code.
If we care about fixing this so processing time isn't increased (we are talking 4 extra condition checks comparing integers), then the only way is to either keep the suppression or I believe we can use reflection to create a test and kill the mutation the only way possible (direct calling the method).