Repository navigation
Evaluate c:forEach items less often when replaying decisions - #6149
Merged
Merged
Conversation
encodeAll() evaluates rendered before pushComponentToEL and encodeBegin()
evaluates it after, so #{component} is the parent in the first and the
component itself in the second. Reusing the first result changes what is
rendered. Document this in encodeBegin() and pin it with a test.
Also correct the javadoc of cachedIsRendered, which claimed that an
aborted encode cannot leave a stale value.
Refs #6148
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With restoreBuildTimeDecisions, the build which restores the view resolved the items a second time to check each row, and the two decisions of one iteration each evaluated them before rendering. Reuse the value in the restoring build, and combine both decisions. Refs #6148 Co-Authored-By: Claude Opus 5.5 <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 #6148
With
com.sun.faces.restoreBuildTimeDecisions, theitemsof a<c:forEach>are now resolved less often on a postback:The restoring build reuses the value it already resolved, and the two decisions of one iteration share one evaluation. The value is only reused while restoring a view, because a
actionorpreRenderViewlistener can replace the items before rendering.The issue also proposed evaluating
renderedonce perencodeAll. That is not possible before Faces 5.0, whereencodeAll()evaluates it with the component pushed (jakartaee/faces#1002): hereencodeAll()evaluates it beforepushComponentToELandencodeBegin()after it, so#{component}differs between them. A page where the expression is true for the parent and false for the component rendered differently with the cache. This PR documents that inencodeBegin()and pins it with a test.Tests: added
UIComponentBaseEncodeAllTestandIterationBaseCacheTest. The impl unit tests pass. The getter counts above were measured on a running application. No integration test covers them yet.🤖 Generated with Claude Opus 5.5