jakartaee / jakartaee/faces

Add default implementation for UIComponent#getFamily()

Open
#1,295 5 comments 0 reactions 0 assignees View on GitHub
Component: Components/Renderers ease_of_development Priority: Major Type: Improvement
Dominant language
Java
Stars
127
Forks
59
Avg merge
23h
Merged PRs (30d)
7

Description

Custom components inheriting from UIComponentBase are currently required to provide an implementation for UIComponent#getFamily() as it's an abstract method.

This is a small nuisance for simple custom components (e.g. ones used internally by some application), which rarely have any need for distinguishing components based on family.

Typically those components just return the empty string or null (#1267")) or some nonsense string like "whatshouldido.with.this".

If developers are not providing any meaningful return value for this method, I guess JSF might just as well provide a default implementation in UIComponentBase (e.g. a method just returning null), thereby making custom components yet again a tiny bit easier to create.

Contributor guide

Open the contributing guide

Research direction

Start by reading UIComponentBase and the abstract UIComponent#getFamily() contract, then review the discussion referenced by issue #1267 for the expected behavior. Confirm whether the default should return null or an empty string and identify the relevant component tests; done means simple custom components no longer need to implement getFamily() while existing behavior remains compatible.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.