-
Notifications
You must be signed in to change notification settings - Fork 77
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
Replace Reference.clone()
with new constructor in Java 11 migration
#510
Replace Reference.clone()
with new constructor in Java 11 migration
#510
Conversation
src/test/java/org/openrewrite/java/migrate/ReferenceCloneMethodTest.java
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/migrate/ReferenceCloneMethodTest.java
Show resolved
Hide resolved
…radh/rewrite-migrate-java into recipe_ReferenceCloneMethod
…dTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…dTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Reference.clone()
with new constructor in Java 11 migration
src/main/java/org/openrewrite/java/migrate/ReferenceCloneMethod.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new recipe @AnuRam123 ; good to see you back!
I've made some changes to your recipe to also clear out the fully qualified types, and remove the type casts that are no longer necessary with the new constructors. Hope you agree!
Thanks @timtebeek yes I was looking into TypeCast and wasn't sure how to go about it. This recipe is now perfect! |
What's changed?
This PR contains recipe:
org.openrewrite.java.migrate.ReferenceCloneMethod
This rule:
What's your motivation?
The custom recipe, replaces the calls to
java.lang.ref.Reference.clone()
with a constructor call passing in the referent and reference queue as parameters.Anyone you would like to review specifically?
@timtebeek
@cjobinabo
Checklist