Skip to content

Commit 8ff2f5b

Browse files
evie-lautimtebeek
andauthored
Add notes for Faces 4.0 FacesManagedBeansRemoved (#1025)
* Add notes for Faces 4.0 FacesManagedBeansRemoved. #1023 * Update ManagedProperty annotations for Jakarta Faces 4 --------- Co-authored-by: Tim te Beek <tim@moderne.io>
1 parent 69aeb40 commit 8ff2f5b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/main/resources/META-INF/rewrite/jakarta-faces-4.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ description: >-
224224
This recipe substitutes Faces Managed Beans, which were deprecated in JavaServer Faces 2.3 and have been removed from Jakarta Faces 4.0.
225225
preconditions:
226226
- org.openrewrite.Singleton
227+
# Previous Faces 3.0 docs show new replacements: https://jakarta.ee/specifications/faces/3.0/apidocs/jakarta/faces/bean/package-summary
228+
# Additional docs: https://docs.redhat.com/en/documentation/red_hat_jboss_enterprise_application_platform/8.0/html/migration_guide/application-migration-from-jakarta-ee-8-to-ee-10_default#faces-managed-beans_default
227229
recipeList:
228230
- org.openrewrite.java.ChangeType:
229231
oldFullyQualifiedTypeName: javax.faces.bean.ApplicationScoped
@@ -233,10 +235,16 @@ recipeList:
233235
oldFullyQualifiedTypeName: jakarta.faces.bean.ApplicationScoped
234236
newFullyQualifiedTypeName: jakarta.enterprise.context.ApplicationScoped
235237
ignoreDefinition: true
238+
# Refer to https://github.com/openrewrite/rewrite-migrate-java/issues/1023
239+
# TODO: CustomScoped is replaced by Context, but not straightforward ChangeType. Custom recipe for @CustomScoped to use CDI custom scopes
240+
# Docs: https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#defining_new_scope_type
236241
- org.openrewrite.java.ChangeType:
237242
oldFullyQualifiedTypeName: javax.faces.bean.ManagedProperty
238243
newFullyQualifiedTypeName: jakarta.faces.annotation.ManagedProperty
239244
ignoreDefinition: true
245+
- org.openrewrite.java.RemoveAnnotationAttribute:
246+
annotationType: jakarta.faces.annotation.ManagedProperty
247+
attributeName: name
240248
- org.openrewrite.java.ChangeType:
241249
oldFullyQualifiedTypeName: jakarta.faces.bean.ManagedProperty
242250
newFullyQualifiedTypeName: jakarta.faces.annotation.ManagedProperty
@@ -249,6 +257,7 @@ recipeList:
249257
oldFullyQualifiedTypeName: jakarta.faces.bean.NoneScoped
250258
newFullyQualifiedTypeName: jakarta.enterprise.context.Dependent
251259
ignoreDefinition: true
260+
# ReferencedBean has no replacement, was never widely adopted
252261
- org.openrewrite.java.ChangeType:
253262
oldFullyQualifiedTypeName: javax.faces.bean.RequestScoped
254263
newFullyQualifiedTypeName: jakarta.enterprise.context.RequestScoped

0 commit comments

Comments
 (0)