Skip to content
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

Faces 4.0: remove deprecated "current component" constants from UIComponent #1571

Closed
BalusC opened this issue Apr 19, 2021 · 4 comments
Closed
Milestone

Comments

@BalusC
Copy link
Member

BalusC commented Apr 19, 2021

Following constants must be removed from UIComponent.

    public static final String CURRENT_COMPONENT = "jakarta.faces.component.CURRENT_COMPONENT";

    public static final String CURRENT_COMPOSITE_COMPONENT = "jakarta.faces.component.CURRENT_COMPOSITE_COMPONENT";

    public static final String HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME = "jakarta.faces.HONOR_CURRENT_COMPONENT_ATTRIBUTES";

They were basically superseded by UIComponent#getCurrentComponent() and getCurrentCompositeComponent() methods.

History: eclipse-ee4j/mojarra#1627

The guarantee that the current and current composite components are
available through FacesContext.getAttributes() doesn't seem right for
several reasons:

  1. It isn't useful. The static methods
    UIComponent.getCurrentComponent() and
    UIComponent.getCurrentCompositeComponent() are more convenient and typesafe.
  2. It is dangerous. If the values of these attributes is set, the
    current stack will be messed up
  3. When we aren't using the particular space-inefficient implementation
    the JSF RI currently uses, maintaining these attributes just in case a
    developer tries to request them is a waste
@BalusC BalusC changed the title Faces 4.0: remove deprecated "current component" methods and param from UIComponent Faces 4.0: remove deprecated "current component" constants from UIComponent Apr 19, 2021
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Apr 19, 2021
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Apr 19, 2021
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Apr 19, 2021
@BalusC
Copy link
Member Author

BalusC commented Apr 19, 2021

TODO: update spec to undocument jakarta.faces.HONOR_CURRENT_COMPONENT_ATTRIBUTES context param (if any at all).

Update: cannot find it, so no changes over there.

@tandraschko
Copy link

+1
will be my next task in MF

@tandraschko
Copy link

COmmited now

@arjantijms
Copy link
Contributor

COmmited now

\o/

@BalusC BalusC closed this as completed May 23, 2021
@arjantijms arjantijms added this to the 4.0 milestone Nov 29, 2021
@arjantijms arjantijms added the 4.0 label Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants