-
Notifications
You must be signed in to change notification settings - Fork 75
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
PreferJavaUtilObjectsEquals does not check for existing equals method #434
Comments
Hi! Thanks for the report; I'm looking at your samples and how we've implemented this recipe rewrite-migrate-java/src/main/resources/META-INF/rewrite/no-guava.yml Lines 189 to 194 in c82c73a
With the example above I see one |
I found the original code again! The number of arguments does seem to be an issue for Java, the (IntelliJ) error message is "Expected 1 arguments but found 2", so I assume java cannot handle the same method name, defined in a class and statically imported from somewhere else with a different number of parameters.
I've observed this in the original code with a custom type (Foo) and Strings. I hope this helps, let me know if you can't reproduce this. |
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
I haven't compiled this, but I hope the point gets across: the unconditional static import of
java.util.Objects.equals
is shadowed by the existingequals
methodWhat did you expect to see?
What did you see instead?
Are you interested in contributing a fix to OpenRewrite?
No, just letting you know.
The text was updated successfully, but these errors were encountered: