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

Patching no longer works for experimental checks like StatementSwitchToExpressionSwitch #4395

Open
PhilippWendler opened this issue May 14, 2024 · 0 comments

Comments

@PhilippWendler
Copy link

PhilippWendler commented May 14, 2024

On my code base, running Error Prone with -Xep:StatementSwitchToExpressionSwitch:WARN -XepOpt:StatementSwitchToExpressionSwitch:EnableDirectConversion=true produces findings.

However, if I want to enable patching and pass -Xep:StatementSwitchToExpressionSwitch:WARN -XepOpt:StatementSwitchToExpressionSwitch:EnableDirectConversion=true -XepPatchChecks:StatementSwitchToExpressionSwitch -XepPatchLocation:..., no findings are shown and no error-prone.patch is generated anymore since 2.26.0.

If I go back to Error Prone 2.25.0, producing patches for StatementSwitchToExpressionSwitch works as expected with these command-line parameters. Version 2.26.0 and 2.27.1 both disable StatementSwitchToExpressionSwitch if I ask for patches from it.

I suspect that this is due to #4028 and that other experimental (disabled by default) checks suffer from the same problem, but I did not test this.

IMHO Error Prone could just enable an experimental check if it is used with -XepPatchChecks, even if it is not enabled explicitly, but I am also fine with having to pass both -Xep:StatementSwitchToExpressionSwitch:WARN and -XepPatchChecks:StatementSwitchToExpressionSwitch.

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

1 participant