You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/05/23 05:21:13 UTC

[jira] [Commented] (SLING-5741) discarding complete ResourceBundleCache in case of JSON dictionary

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

ASF GitHub Bot commented on SLING-5741:
---------------------------------------

GitHub user anagarwa opened a pull request:

    https://github.com/apache/sling/pull/143

    SLING-5741 discarding complete ResourceBundleCache in case of JSON di…

    …ctionary

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/anagarwa/sling SLING-5741

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/sling/pull/143.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #143
    
----
commit 083869ede3b4cfe8ed82b8b771e7e1daf0c651a8
Author: Ankit Agarwal <an...@adobe.com>
Date:   2016-05-23T05:14:17Z

    SLING-5741 discarding complete ResourceBundleCache in case of JSON dictionary

----


> discarding complete ResourceBundleCache in case of JSON dictionary
> ------------------------------------------------------------------
>
>                 Key: SLING-5741
>                 URL: https://issues.apache.org/jira/browse/SLING-5741
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: i18n 2.4.6
>            Reporter: Ankit Agarwal
>
> In case user is using JSON dictionary then condition mentioned here https://github.com/apache/sling/blob/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java#L198
> will becomes true for any change in languagerootpaths which are cached. And this will discard complete resource bundle cache. which is different if user is using sling:Message dictionary.
> for example user has json dictionary at path  
> "/libs/test/i18n/de.json"
> and also resource bundle for language "de" is cached so , "libs/test/i18n/de.json" will be in languageRootPaths.
> So any change at "/libs/test/i18n/de.json" will discard complete resourcebundleCache.
> Where as in case of  sling:dictionary 
> languageRootPath will be like "/libs/test/i18n/de" 
> and any change in this dictionary will have path like this "/libs/test/i18n/de/testMessage" so condition becomes false and complete resourcebundleCache. will not be discarded.
> Can we improve this, like if condition becomes true, than check among the cached resourceBundle to which resourceBundle this path belongs to and than discarding that resourceBundle. and if this resourceBundle is parent of any ResourceBundle then discard that too. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)