openrewrite / openrewrite/rewrite-migrate-java

FacesManagedBeansRemoved for Faces 4.0 recipe updates

Open
#1,023 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
156
Forks
130
Avg merge
20h 57m
Merged PRs (30d)
21

Description

Faces 4.0 recipe - FacesManagedBeansRemoved - needs additions

I found a few things the org.openrewrite.java.migrate.jakarta.FacesManagedBeansRemoved recipe is missing.

Reference documents

Missing fixes

1. CustomScoped
Image
  • java.faces.bean.CustomScoped and jakarta.faces.bean.CustomScoped seem to need a custom recipe to use CDI custom scopes and jakarta.enterprise.context.spi.Context. Unsure of recipe scope, and if feasible.

Migration case with build error:

[ERROR] ... package jakarta.faces.bean does not exist
[ERROR] ... cannot find symbol
[ERROR]   symbol: class CustomScoped
Additional analysis: https://github.com/openrewrite/rewrite-migrate-java/pull/1025#issuecomment-4112880851

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.

✅ 2. ManagedProperty name - fixed in #1025/#1027

Faces 3.0 ManagedProperty doc
Faces 4.0 ManagedProperty doc

  • name was an optional element in Faces 3.0, and removed in Faces 4.0. Possibly remove entirely unless there is another migration path to maintain functionality.

Migration case with build error:

[ERROR] ... cannot find symbol
[ERROR]   symbol:   method name()
[ERROR]   location: @interface jakarta.faces.annotation.ManagedProperty

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/main/resources/META-INF/rewrite/jakarta-faces-4.yml at the FacesManagedBeansRemoved recipe and review the Faces 3.0/4.0 and Red Hat migration references. Focus on the remaining CustomScoped case; the issue notes that it is not a simple ChangeType and may require a custom Java recipe plus CDI Context work. Done requires an agreed feasible scope and corresponding migration coverage; ManagedProperty is already fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.