boolean global = "true".equals(globalStr);
Locale locale = (Locale) context.get("locale");
String resource = this.resourceExdr.expandString(context, locale);
ResourceBundleMapWrapper existingPropMap = this.mapNameAcsr.get(context);
if (existingPropMap == null) {
this.mapNameAcsr.put(context, UtilProperties.getResourceBundleMap(resource, locale, context));
} else {
try {
existingPropMap.addBottomResourceBundle(resource);
} catch (IllegalArgumentException e) {
// log the error, but don't let it kill everything just for a typo or bad char in an l10n file
Debug.logError(e, "Error adding resource bundle [" + resource + "]: " + e.toString(), module);
}
}
if (global) {
Map<String, Object> globalCtx = UtilGenerics.checkMap(context.get("globalContext"));
if (globalCtx != null) {
ResourceBundleMapWrapper globalExistingPropMap = this.mapNameAcsr.get(globalCtx);
if (globalExistingPropMap == null) {
this.mapNameAcsr.put(globalCtx, UtilProperties.getResourceBundleMap(resource, locale, context));
} else {
// is it the same object? if not add it in here too...
if (existingPropMap != globalExistingPropMap) {
try {
globalExistingPropMap.addBottomResourceBundle(resource);
} catch (IllegalArgumentException e) {
// log the error, but don't let it kill everything just for a typo or bad char in an l10n file
Debug.logError(e, "Error adding resource bundle [" + resource + "]: " + e.toString(), module);
}
}