[
https://issues.apache.org/jira/browse/MYFACES-2672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860804#action_12860804
]
Martin Marinschek commented on MYFACES-2672:
--------------------------------------------
Hi Leonardo,
clearly you will need to reset the cached instance when a behaviour is added -
but apart from this, the caching is certainly good.
best regards,
Martin
> Don't create more wrappers for _behaviorsMap than necessary
> -----------------------------------------------------------
>
> Key: MYFACES-2672
> URL: https://issues.apache.org/jira/browse/MYFACES-2672
> Project: MyFaces Core
> Issue Type: Task
> Components: JSR-314
> Affects Versions: 2.0.0
> Reporter: Leonardo Uribe
> Assignee: Leonardo Uribe
> Fix For: 2.0.1-SNAPSHOT
>
>
> Actually we have a code on UIComponentBase.wrapBehaviorsMap() that each time
> it is called it returns a Collections.unmodifiableMap(_behaviorsMap). I think
> we can use a transient variable here to hold the resulting instance, and each
> time it is called return it. Collections.unmodifiableMap is just a wrapper of
> the real one, so we can cache it safely here.
> UIComponentBase.getClientBehaviors could be called many times for the same
> component when it is rendered. I think it is worth to do it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.