-
Notifications
You must be signed in to change notification settings - Fork 746
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
Add BugChecker.SwitchExpressionTreeMatcher
to support checking of switch
expressions
#4119
Comments
I'm not sure if there's a way to do this without overriding visitor methods that only exist on newer JDK versions, which I don't think we can't use until the minimum supported JDK version is increased. It's possible we can use some combination of reflection or proxies, and that might have acceptable performance. If that doesn't work, perhaps multi-release jars could help here. |
To support this feature while also still supporting running Error Prone on JDK 11, possibly an approach could be taken similar to how GJF supports |
Upon further thought, this may be a bit ugly to support on JDK 11. The issue is that the |
That seems like it could work. Similarly, I had wondered at some point about providing It would be a wart forever, though we could try to partially smooth it over in the future by making a binary-compatible but source-incompatible change of the method to |
FWIW, it seems Checker Framework has gone with the option of just passing in a And they override |
Right now, Error Prone checkers cannot perform checks on
switch
expressions as there is not yet aBugChecker.SwitchExpressionTreeMatcher
interface to override. See also discussion at #3803 (comment).The text was updated successfully, but these errors were encountered: