-
Notifications
You must be signed in to change notification settings - Fork 70
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
Convert Guava Optional to JDK #197
Comments
There could be a few more small corner cases. The Guava Javadoc actually tell you what the difference is and what the Java equivalent is. Also note that version 21 added the utilities |
That I think we can cover most of these quite nicely with declarative recipes already; the remaining ones might be doable with rewrite templates once that's further along, and don't seem to be as highly used as some of the other ones. |
I thought a bit about this recipe and it seems like it could be a bit difficult to implement if we have to ensure that the type attribution is still correct everywhere. But I may think about it the wrong way. |
Looking at some of the other recipes we seem to mostly call out to rewrite-migrate-java/src/main/resources/META-INF/rewrite/no-guava.yml Lines 61 to 95 in bb9015b
|
I guess you are right. It probably just gets a bit weird when we rewrite uses of Guava |
The other problem I was thinking of is what happens to the type attribution between the Cases like |
Mostly implemented in #202 ; propose we close this one and pick up the |
We already have quite some recipes to convert Guava classes to standard JDK equivalents:
https://github.com/openrewrite/rewrite-migrate-java/blob/main/src/main/resources/META-INF/rewrite/no-guava.yml
Seems like Guava's Optional could be a nice addition to the list of supported migrations.
Guava
https://guava.dev/releases/19.0/api/docs/com/google/common/base/Optional.html
JDK
https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html
Quick analysis
There's a few cases that will need to be looked at in detail, such as:
The text was updated successfully, but these errors were encountered: