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

jakarta.faces.component.html: remove OPTIMIZED_PACKAGE #5129

Merged
merged 2 commits into from
Jun 26, 2022

Conversation

Emkas
Copy link
Contributor

@Emkas Emkas commented Jun 24, 2022

Method #handleAttribute was probably added to all jakarta.faces.component.html package's classes. But not in all cases this method is used.

@BalusC
Copy link
Contributor

BalusC commented Jun 25, 2022

But not in all cases this method is used.

This is a leftover of the JSF 1.x era when those classes in javax.faces.component.html were autogenerated based on some XML configuration file. At some point in time the generator was shut down and the last generated classes were plainly copypasted into the package (I guess this was around the time of JSF 2.0 work, I can't find/tell the exact moment/reason, @arjantijms can perhaps tell more).

I'd like to see this PR to be changed to simply deduplicate all those handleAttribute() methods into a package private static helper class with a single method so that you can ultimately use e.g. HtmlComponentUtils.handleAttribute(this, "foo", foo); (via static import ofcourse). Do note that it's perfectly acceptable to have a package private static helper class, see also *Utils classes in jakarta.faces.component package.

@Emkas
Copy link
Contributor Author

Emkas commented Jun 25, 2022

@BalusC I wanted to do this "the smart way" but to be honest I was defeated since I tried to use interface for this. There is no place to hide the method, so I can be only public.

I thought that you would not like such a util class. But if you do, no problem! I'd update my PR.

@Emkas Emkas force-pushed the optimized_package branch 3 times, most recently from 3bbc5c6 to 8280b73 Compare June 25, 2022 20:50
@Emkas
Copy link
Contributor Author

Emkas commented Jun 25, 2022

OK. I added HtmlComponentUtils.handleAttribute(this, "foo", foo);. There's the same code in com.sun.faces.component.PassthroughElement but there I only added @SuppressWarnings("unchecked") and a TODO.

Signed-off-by: Emil Sierżęga <emilsierzega@gmail.com>
Signed-off-by: Emil Sierżęga <emilsierzega@gmail.com>
@BalusC BalusC merged commit 00e66ae into eclipse-ee4j:master Jun 26, 2022
@Emkas Emkas deleted the optimized_package branch June 26, 2022 15:20
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

Successfully merging this pull request may close these issues.

2 participants