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

Marius Petoi commented on MYFACES-2774:
---------------------------------------

Hi Leonardo,

Stack inherits Vector, so it has all its methods synchronized. This is not very 
performance-efficient, so it would be better to use ArrayList instead. A 
HashMap is created every time the markForDeletion and finalizeForDeletion 
methods are invoked. So, a HashMap is created for each component for which the 
methods are invoked. This way, the add, get and remove methods are invoked only 
once per component and always for the last element (in the ArrayList). This 
way, the advantages of the HashMap are also used. When the component has no 
children or facets, there is no problem. the algorithm iterates over the 
children and facets of the component and then checks whether they are marked as 
deleted. So, it is ok.

I shall replace the Stack with an ArrayList, that is used as a stack. I shall 
upload the patch once I will have finished.

Regards,
Marius

> Remove MARK_DELETED attribute from the component
> ------------------------------------------------
>
>                 Key: MYFACES-2774
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2774
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General, JSR-314
>    Affects Versions: 2.0.0
>            Reporter: Marius Petoi
>            Priority: Minor
>         Attachments: markDeletedFaceletContext.patch, 
> markDeletedFaceletContext2.patch
>
>
> The ComponentSupport.MARK_DELETED attribute is used only inside one request. 
> It doesn't need to be saved in the state. It should be removed from the 
> attributes of the component. Instead a list of components marked for deletion 
> should be included in the FaceletContext.

-- 
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