javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2395

unnecessary state saved for temporary trees when using partial state saving.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.7
    • Fix Version/s: 2.1.9, 2.2.0-m03
    • Component/s: None
    • Labels:
      None

      Description

      During rendering we sometimes add a subtree, render, then remove the subtree. In full state saving by the time you get to doing state saving the subtree is gone and there's nothing to state save.

      Previously in partial state saving if you added a subtree but removed it, the handleRemoveEvent code went through the add list and if the component was in the add list then it removed it from the add list, this way we didn't try to add it during restore view. Here's the old code I'm looking at in StateContext.AddRemoveListener:

      private void handleRemoveEvent(FacesContext context,
      PreRemoveFromViewEvent event) {

      // CODE HERE REMOVED

      if (dynamicAdds != null && dynamicAdds.containsKey(clientId))

      { dynamicAdds.remove(clientId); }

      // CODE HERE REMOVED
      }

      I don't see anything similar in the new code, it looks to me like the subtree is state saved and on restore view you try to add/remove the subtree.

        Activity

        Hide
        gabfest added a comment -

        This behavior looks like it was changed as part of the fix for Issue 1826

        Show
        gabfest added a comment - This behavior looks like it was changed as part of the fix for Issue 1826
        Hide
        Manfred Riem added a comment -

        If you mark a sub tree as transient it is not tracked for the purposes of dynamic manipulation and as such is also not state saved. Relevant code can be found in the AddRemoveListener.handleAdd and handleRemove. See https://svn.java.net/svn/mojarra~svn/branches/MOJARRA_2_1X_ROLLING/jsf-ri/src/main/java/com/sun/faces/context/StateContext.java

        Show
        Manfred Riem added a comment - If you mark a sub tree as transient it is not tracked for the purposes of dynamic manipulation and as such is also not state saved. Relevant code can be found in the AddRemoveListener.handleAdd and handleRemove. See https://svn.java.net/svn/mojarra~svn/branches/MOJARRA_2_1X_ROLLING/jsf-ri/src/main/java/com/sun/faces/context/StateContext.java
        Hide
        Manfred Riem added a comment -

        Auto pruning of the dynamic adds and removes is done once a dynamic component
        is added or removed.

        Show
        Manfred Riem added a comment - Auto pruning of the dynamic adds and removes is done once a dynamic component is added or removed.

          People

          • Assignee:
            Manfred Riem
            Reporter:
            gabfest
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 3 days
              3d