You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: After the existing ChangeType migrates jakarta.faces.bean.ManagedProperty → jakarta.faces.annotation.ManagedProperty, the name attribute causes a compile error because Faces 4.0's @ManagedProperty doesn't have a name element.
Solution: The existing org.openrewrite.java.RemoveAnnotationAttribute recipe from rewrite-java core handles this — no custom Java code needed. Just add a YAML entry after the ChangeType steps:
- org.openrewrite.java.RemoveAnnotationAttribute:
annotationType: jakarta.faces.annotation.ManagedPropertyattributeName: name
Only the post-migration type (jakarta.faces.annotation.ManagedProperty) is needed since ChangeType runs first in the recipe list.
2. @CustomScoped migration
Problem: jakarta.faces.bean.CustomScoped was removed in Faces 4.0 with no direct replacement. The CDI equivalent involves defining a custom scope annotation with @NormalScope or @Scope, plus registering a Context implementation — this is NOT a simple ChangeType.
Status: This would require a custom Java recipe and the migration path isn't mechanical (the issue author also notes "unsure of recipe scope, and if feasible"). Skipping for now.
Does that removal through RemoveAnnotationAttribute make sense to you? Or would that lose something we still need to migrate?
I have no personal experience with usage of these annotations, but it seems to make sense to me.
The current case is compilation error. And with removing the attribute, it seems the name is automatically based on the annotated field's name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's changed?
Add notes in recipe for future enhancements
What's your motivation?