Simplify PostRestoreStateEvent delivery requirements
----------------------------------------------------

                 Key: MYFACES-2750
                 URL: https://issues.apache.org/jira/browse/MYFACES-2750
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-314
    Affects Versions: 2.0.0
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe
            Priority: Critical


See: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=806

It was fixed for 2.0 Rev a. After reading it the conclusion is it is enough 
important to be included in 2.0.1 release.

By Andy Schwartz:

Short summary of the problem for those who don't want to read through the gory 
details:

The specification is currently a bit too specific about when 
PostRestoreStateEvents should be delivered.  The only requirement should be 
that these events are delivered after the view has been restored, but before we 
move out of the restore view phase.  For example, a reasonable implementation 
would be to deliver these events in the Lifecycle implementation, after the 
state manager has returned the restored view.  However, the spec does not 
currently allow this - eg. the spec requires that 
UIViewRoot.processRestoreState() delivers these events.

Of course, UIViewRoot.processRestoreState isn't always called (only used for 
full state saving), which means that implementations end up having to duplicate 
this logic elsewhere, such as in whatever state manager is used for partial 
state saving.  This has further fallout for custom state managers - ie. custom 
state managers that do not call processRestoreState() must duplicate the event 
delivery logic yet again.

This is much more complicated than necessary.  My recommendation is that we 
simplify the requirements such that implementations are free to deal with 
PostRestoreStateEvent delivery in a saner way.  For example, implementations 
should be able to deliver these events once at the end of the restore view 
phase (and not be required to implement this logic in 
UIViewRoot.processRestoreState()).

I suspect that this small spec change will lead to simpler code in Mojarra 
(definitely) and MyFaces (probably, though I haven't looked at the code).


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to