Skip to content

Drop the RESTORE_VIEW_SCOPE_ONLY context-attribute hack - #5857

Merged
BalusC merged 1 commit into
masterfrom
mojarra_issue_5787
Jul 16, 2026
Merged

Drop the RESTORE_VIEW_SCOPE_ONLY context-attribute hack#5857
BalusC merged 1 commit into
masterfrom
mojarra_issue_5787

Conversation

@BalusC

@BalusC BalusC commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Closes #5787. API side merged as jakartaee/faces#2212; the faces submodule is bumped to 321e6fae1.

FaceletViewHandlingStrategy now calls UIViewRoot.restoreViewScopeState() on the createMetadataView restore path, as prescribed by StateManagementStrategy.restoreView()'s javadoc, instead of putting a RESTORE_VIEW_SCOPE_ONLY context attribute around a full restoreState() call. ViewScopeManager.RESTORE_VIEW_SCOPE_ONLY goes with it, so the string contract between the spec class and the impl is gone from both sides.

Tests. The unit tests for the API change live here rather than in the faces repo, which has no UIViewRoot test, and they reference ViewScopeManager's key constants anyway. testViewMapRestoreViewScopeState pins that restoreViewScopeState() restores the view map and not the component state — the inversion the old stub had. testViewMapRestoreStateAfterRestoreViewScopeState pins that a subsequent restoreState() does not rewire the view map over a replacement minted during buildView(). Against the pre-2212 API they fail with expected: <one> but was: <null> and expected: <replacementViewMapId> but was: <savedViewMapId>; with only 2212's guard removed, exactly the second one fails.

Testing. Full Faces TCK green. mvn clean install in impl green, including the pre-existing UIViewRootTestCase (60) and UIViewRootTest (5).

🤖 Generated with Claude Code (Opus 4.8)

Call UIViewRoot.restoreViewScopeState() from the createMetadataView
restore path, as prescribed by the StateManagementStrategy.restoreView()
javadoc, now that jakartaee/faces#2212 implements it properly. This
replaces setting a RESTORE_VIEW_SCOPE_ONLY context attribute around a
full restoreState() call, and lets the ViewScopeManager constant behind
it go.

Add unit tests for both halves of the API change: that
restoreViewScopeState() restores the view map and not the component
state, and that a subsequent restoreState() does not rewire the view map
over a replacement minted while the view was being built. Both fail
without jakartaee/faces#2212.

Bump the faces submodule to 321e6fae1.

Closes #5787

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@BalusC
BalusC merged commit 7dfce17 into master Jul 16, 2026
3 checks passed
@BalusC
BalusC deleted the mojarra_issue_5787 branch July 16, 2026 12:25
@BalusC BalusC added this to the 5.0.0 milestone Jul 16, 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.

Implement UIViewRoot.restoreViewScopeState() properly and drop the RESTORE_VIEW_SCOPE_ONLY context-attribute hack

1 participant