Drop the RESTORE_VIEW_SCOPE_ONLY context-attribute hack - #5857
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5787. API side merged as jakartaee/faces#2212; the faces submodule is bumped to 321e6fae1.
FaceletViewHandlingStrategynow callsUIViewRoot.restoreViewScopeState()on thecreateMetadataViewrestore path, as prescribed byStateManagementStrategy.restoreView()'s javadoc, instead of putting aRESTORE_VIEW_SCOPE_ONLYcontext attribute around a fullrestoreState()call.ViewScopeManager.RESTORE_VIEW_SCOPE_ONLYgoes 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
UIViewRoottest, and they referenceViewScopeManager's key constants anyway.testViewMapRestoreViewScopeStatepins thatrestoreViewScopeState()restores the view map and not the component state — the inversion the old stub had.testViewMapRestoreStateAfterRestoreViewScopeStatepins that a subsequentrestoreState()does not rewire the view map over a replacement minted duringbuildView(). Against the pre-2212 API they fail withexpected: <one> but was: <null>andexpected: <replacementViewMapId> but was: <savedViewMapId>; with only 2212's guard removed, exactly the second one fails.Testing. Full Faces TCK green.
mvn clean installinimplgreen, including the pre-existingUIViewRootTestCase(60) andUIViewRootTest(5).🤖 Generated with Claude Code (Opus 4.8)