Skip to content

Fix default name evaluation for CDI beans#9350

Open
NicolaIsotta wants to merge 1 commit intoapache:masterfrom
NicolaIsotta:cdi-default-bean-name
Open

Fix default name evaluation for CDI beans#9350
NicolaIsotta wants to merge 1 commit intoapache:masterfrom
NicolaIsotta:cdi-default-bean-name

Conversation

@NicolaIsotta
Copy link
Copy Markdown
Contributor

@NicolaIsotta NicolaIsotta commented Apr 17, 2026

This PR fixes the evaluation of the default name for CDI beans to strictly align with the CDI specifications.

Quoting CDI 1.1 specs:

The default name for a managed bean is the unqualified class name of the bean class, after converting the first character to lower case.
For example, if the bean class is named ProductList, the default bean name is productList.

Subsequent specifications all maintain the exact same text. Here is the latest: Jakarta EE CDI 4.1.

Historical Notes

I'm not exactly sure why the behavior was originally changed. My guess is that some implementations weren't perfectly aligned with the specifications at the time. For historical context on the deviation, see:

NB: this currently targets master, but it would be nice to have this in NB30


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

@NicolaIsotta NicolaIsotta marked this pull request as draft April 17, 2026 15:15
according to the specs, the first char must always be lowercased
@NicolaIsotta NicolaIsotta force-pushed the cdi-default-bean-name branch from 490471f to c0f9db6 Compare April 17, 2026 15:24
@NicolaIsotta NicolaIsotta marked this pull request as ready for review April 17, 2026 15:25
@mbien mbien added Java EE/Jakarta EE [ci] enable enterprise job enterprise [ci] enable enterprise job ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Apr 17, 2026
@apache apache locked and limited conversation to collaborators Apr 17, 2026
@apache apache unlocked this conversation Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) enterprise [ci] enable enterprise job Java EE/Jakarta EE [ci] enable enterprise job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants