Skip to content

Fix #2214: document that UIData row iteration during a tree visit is observable - #2216

Open
BalusC wants to merge 1 commit into
5.0from
issue_2214
Open

Fix #2214: document that UIData row iteration during a tree visit is observable#2216
BalusC wants to merge 1 commit into
5.0from
issue_2214

Conversation

@BalusC

@BalusC BalusC commented Jul 20, 2026

Copy link
Copy Markdown
Member

Documentation only, no behaviour change.

The dangling reference

UIComponent.visitTree()'s spec prose pointed at a package description for jakarta.faces.component.visit that has never existed — there is no package-info.java there — so the "normative specification" for tree visiting was a blank page. It now points at UIComponent.visitTree() and VisitContext, where the text already lives.

No package-info.java was added. It remains defensible on its own merits, but once the two javadocs below are complete there is no normative text left homeless.

Iterating is observable

Nothing stated that a component which visits its children per row does so observably: the visited components see the row index change and may act on it, including by loading that row's data.

VisitHint.SKIP_ITERATION documented only the mechanism and said nothing about why a caller would want it; UIData.visitTree said "iterate over the rows" without mentioning the hint at all. So the only normative text ran one way — iterate — and opting out was left entirely to a caller's discretion.

Both now say so, phrased descriptively rather than normatively. Mojarra and MyFaces already behave exactly this way and PrimeFaces asserts an exact load() count against both, so no implementation has to change to remain conformant; a spec reader can now rely on what was previously only convention.

Motivating case

eclipse-ee4j/mojarra#5864: an internal traversal which existed only to locate components by client id lost SKIP_ITERATION, so it iterated every UIData on the way. PrimeFaces DataTable treats row iteration as its cue to load, so every postback rendering a lazily loaded table ran its backing query twice. Nothing said the hint had to be honoured, so nothing caught it going wrong.

Closes #2214

🤖 Generated with Claude Code (Opus 4.8)

…observable

UIComponent.visitTree()'s spec prose pointed at a package description for
jakarta.faces.component.visit that has never existed, so the "normative
specification" for tree visiting was a blank page. Point it at
UIComponent.visitTree() and VisitContext, where the text already lives.

Separately, nothing stated that a component visiting its children per row
does so observably: the visited components see the row index change and may
load that row's data. VisitHint.SKIP_ITERATION documented only the mechanism
and UIData.visitTree said "iterate over the rows" without mentioning the hint,
so the only normative text ran one way and opting out was left to a caller's
discretion. Both now say so, descriptively.

Documentation only, no behaviour change. Mojarra and MyFaces already behave
this way; see eclipse-ee4j/mojarra#5864 for what happens when a traversal that
only locates components loses the hint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@BalusC
BalusC requested review from arjantijms and tandraschko July 20, 2026 16:39
@BalusC BalusC added this to the 5.0 milestone Jul 28, 2026
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.

1 participant