[ 
https://issues.apache.org/jira/browse/MYFACES-3562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13289235#comment-13289235
 ] 

Leonardo Uribe commented on MYFACES-3562:
-----------------------------------------

The logic around nullDelta and _AttachedDeltaWrapper is intentional.

In simple words, the idea is to restore delta properly we need to differentiate 
between a "null delta" and a "null value".  "null delta" means the component 
has not changes since the last markInitialState(). "null value" can happen in 
two scenarios:

1. If some code forcefully clear the property (converter).
2. If there is no value assigned to the property (or a converter is not set).

I can remember the nullDelta boolean is for case 1. Suppose a converter is 
removed after markInitialState(). In this case _isSetConverter() flag 
activates, but _converter is null, so saveAttachedState() will return null. We 
cannot return null, because to preserve the change, we need to indicate that 
the property was set to null. A check based in converterSaved will skip this 
case, but the check using nullDelta boolean will not.

I know the case proposed is rare, but please note the intention is make PSS 
algorithm 100% compatible with JSF 1.2 state saving. Note the same pattern has 
been used in other places too (for example in componentClass20.vm).
                
> [perf] Optimize UIOutput.saveState(FacesContext)
> ------------------------------------------------
>
>                 Key: MYFACES-3562
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3562
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Martin Kočí
>            Priority: Trivial
>         Attachments: MYFACES-3562.patch
>
>
> 1) use converterSaved as delta change check
> 2)  remove nullDelta boolean
> 3) move  new _AttachedDeltaWrapper into if (attachedState != null) statement
> question: _AttachedDeltaWrapper used in this context provides Class of 
> Converter, but that info is not used in restoreState - can we remove usage of 
> that wrapper?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to