We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 this to InstanceOfPatternMatchTest
@Test void multipleCastsSameType() { rewriteRun( //language=java java( """ public class A { void test(Object first, Object second) { if (first instanceof String && second instanceof String) { System.out.println((String) first); System.out.println((String) second); } } } """, """ public class A { void test(Object first, Object second) { if (first instanceof String string1 && second instanceof String string2) { System.out.println(string1); System.out.println(string2); } } } """ ) ); }
Both instanceof checks use the same identifier:
public class A { void test(Object first, Object second) { if (first instanceof String string && second instanceof String string) { System.out.println(string); System.out.println(string); } } }
No, sorry.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue! We're already working on this in
After seeing in reported before in
Hope you don't mind me closing this issue as a duplicate; it's still appreciated, but best tracked in the existing issues.
Sorry, something went wrong.
No branches or pull requests
What is the smallest, simplest way to reproduce the problem?
Add this to InstanceOfPatternMatchTest
What did you see instead?
Both instanceof checks use the same identifier:
Are you interested in contributing a fix to OpenRewrite?
No, sorry.
The text was updated successfully, but these errors were encountered: