-
Notifications
You must be signed in to change notification settings - Fork 73
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
Fix #457: Refactor javax.annotation to ChangePackage #525
Conversation
Thanks for the simplification! I do notice these hints in the git history:
But perhaps we can undo that unintended change with a simple addition of - org.openrewrite.java.ChangePackage:
oldPackageName: jakarta.annotation.processing
newPackageName: javax.annotation.processing That would keep this straightforward while still resolving #457 |
YUCK....let me research. |
@timtebeek i made the change but i think maybe the README.MD needs to be update with build instructions? |
Ah yes I can see it might take some getting used to with Gradle; the instructions are documented here:
TLDR: Thanks again for providing the fix here! Great to have that troublesome behavior of ChangeType-in-bulk-on-larger-projects resolved. |
Hi! not sure if I'm right here or if I should open a proper bug report. This PR kinda broke my jakarta ee 10 migration, because we use a few spotbugs annotations that also live under javax.annotations (which are part of JSR305 (mostly frozen?), we get them via com.google.code.findbugs:annotations, which gets pulled in by spotbugs-annotations). I think in our case those annotations could just as well get migrated to the associated spotbugs annotations ( I'm not sure if this use case is important enough to warrant a bug report though, since someone else exporting classes in the javax.annotation namespace is weird enough. |
yeah that is weird they should not be doing that :) I would report a bug to SpotBugs/FindBugs to have them fix it. |
Thanks for the heads up @mr1chter ; Indeed we would not have expected spotbugs to add recipes to the javax.annotation package. I'd report it there first. For your particular case you can write your own recipe that undoes the changes made here with the addition of this step - org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: jakarta.annotation.Nonnegative
newFullyQualifiedTypeName: javax.annotation.Nonnegative I hope that helps! |
Hi @timtebeek. I'm encountering this problem. There are a bunch of annotations in Does org.openrewrite.java.ChangeType and org.openrewrite.java.ChangePackage require type resolution in order to work? If so, then the following might not work since
|
Maybe we should add an exceptions option to ChangePackage. |
What's changed?
Fix #457: Refactor javax.annotation to ChangePackage
Change from renaming individual Classes to ChangePackage. Not sure why it was going to all this trouble for individual names when one ChangePackage will do.
What's your motivation?
@PostConstruct
import being removed from beans #457Checklist