You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2013/04/22 11:05:16 UTC

[jira] [Resolved] (JCR-3571) Light optimizatin for CachingNameResolver.getJCRName(Name)

     [ https://issues.apache.org/jira/browse/JCR-3571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger resolved JCR-3571.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7

Looks good to me.

Applied patch in revision 1470414.

Thanks Sergiy.
                
> Light optimizatin for CachingNameResolver.getJCRName(Name)
> ----------------------------------------------------------
>
>                 Key: JCR-3571
>                 URL: https://issues.apache.org/jira/browse/JCR-3571
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.2.13, 2.4.3, 2.5.3, 2.6
>            Reporter: Sergiy Shyrkov
>            Priority: Minor
>             Fix For: 2.7
>
>         Attachments: CachingNameResolver.patch
>
>
> In case of a Name which has no namespace (name.getNamespaceURI().length() == 0) there is perhaps no need to cache the resolved jcrName as it will be getLocalName().
> If this is true, than I would like to suggest the following slight optimization in the org.apache.jackrabbit.spi.commons.conversion.CachingNameResolver.getJCRName(Name) method:
>     public String getJCRName(Name name) throws NamespaceException {
>         if (name.getNamespaceURI().length() == 0) {
>             return name.getLocalName();
>         }
>         String jcrName = (String) cache.get(name);
> ...
> This will return earlier and "save" the lookup in the cache and further cache.put() (the GenerationalCache.put(Object, Object) is synchronized so avoiding the call makes things potentially faster).
> Thank you in advance!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira