Skip to content
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

RemoveSwitchMutator: print case's id and not order number alone #1098

Closed
rnveach opened this issue Oct 21, 2022 · 1 comment
Closed

RemoveSwitchMutator: print case's id and not order number alone #1098

rnveach opened this issue Oct 21, 2022 · 1 comment

Comments

@rnveach
Copy link
Contributor

rnveach commented Oct 21, 2022

Identified at checkstyle/checkstyle#12318 (comment),

It was not clear that the case number being reported by RemoveSwitchMutator is not always the same order as in the source. I understand pitest goes against the bytecode, but I would think a normal person would assume they would be the same unless they work with the byecode a lot.

My suggestion is to add the case number with the integer value of the switch in the description. I contemplate removing the order number all together, but as long as the description is made a bit clearer, I think it is ok. If the case order could be reversed back to the source order, that would also be acceptable, but I assume that may be too complex while the number should be directly available from the bytecode.

So a case like:

67: 140 // 3

Would be reported like:

<description>RemoveSwitch 3 mutation with case value of 67</description> 

Instead of:

<description>RemoveSwitch 3 mutation</description> 
@hcoles
Copy link
Owner

hcoles commented Oct 24, 2022

@rnveach This will be a little confusing for string switches, but I agree it would be an improvement the rest of the time and shouldn't be too hard to implement.

@hcoles hcoles closed this as completed in b93565e Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants