You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2005/12/01 10:34:24 UTC
svn commit: r350219 -
/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/XMLResourceBundleFactory.java
Author: joerg
Date: Thu Dec 1 01:34:18 2005
New Revision: 350219
URL: http://svn.apache.org/viewcvs?rev=350219&view=rev
Log:
Fixed yet another issue with caching of i18n bundles when using multiple locations.
Modified:
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/XMLResourceBundleFactory.java
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/XMLResourceBundleFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/XMLResourceBundleFactory.java?rev=350219&r1=350218&r2=350219&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/XMLResourceBundleFactory.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/XMLResourceBundleFactory.java Thu Dec 1 01:34:18 2005
@@ -235,7 +235,7 @@
", directory: " + directories[index]);
}
- final String cacheKey = getCacheKey(directories, index, name, locale);
+ final String cacheKey = "XRB" + getCacheKey(directories, index, name, locale);
XMLResourceBundle bundle = selectCached(cacheKey);
if (bundle == null) {
@@ -318,10 +318,14 @@
*/
protected String getCacheKey(String[] directories, int index, String name, Locale locale)
throws ComponentException {
- StringBuffer cacheKey = new StringBuffer("XRB");
- for (; index < directories.length; index++) {
+ StringBuffer cacheKey = new StringBuffer();
+ if (index < directories.length) {
cacheKey.append(":");
cacheKey.append(getSourceURI(directories[index], name, locale));
+ index++;
+ cacheKey.append(getCacheKey(directories, index, name, locale));
+ } else if ((locale != null && !locale.getLanguage().equals(""))) {
+ cacheKey.append(getCacheKey(directories, 0, name, getParentLocale(locale)));
}
return cacheKey.toString();
}