bruno 2003/05/20 07:47:13
Modified: src/java/org/apache/cocoon/transformation
I18nTransformer.java
Log:
Added synchronize in the getCatalogue() method, as suggested by
Michael Enke in bugzilla entry 19881.
The whole concept of calling configure() again and again on the
BundleFactory seems to violate Avalon principles though.
Revision Changes Path
1.6 +8 -5
cocoon-2.1/src/java/org/apache/cocoon/transformation/I18nTransformer.java
Index: I18nTransformer.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/I18nTransformer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- I18nTransformer.java 13 May 2003 07:04:16 -0000 1.5
+++ I18nTransformer.java 20 May 2003 14:47:13 -0000 1.6
@@ -618,7 +618,7 @@
* int-currency-no-unit</code>.
* Also used with <code>i18:translate</code> to indicate inplace
* translations: <code>inplace</code>
- * @deprecated since 2.1. Use nested tags instead, e.g.:
+ * @deprecated since 2.1. Use nested tags instead, e.g.:
* <i18n:param><i18n:date/></i18n:param>
*/
public static final String I18N_TYPE_ATTRIBUTE = "type";
@@ -1046,9 +1046,12 @@
private Bundle getCatalogue(String name, String location) throws
Exception
{
- configureFactory(location);
- return (Bundle)factory.select(name, locale);
+ synchronized (factory) {
+ configureFactory(location);
+ return (Bundle)factory.select(name, locale);
+ }
}
+
/**
* Internal setup of XML resource factory.
*
@@ -1856,7 +1859,7 @@
int fractionDigits = -1;
try {
String fd = (String)params.get(I18N_FRACTION_DIGITS_ATTRIBUTE);
- if (fd != null)
+ if (fd != null)
fractionDigits = Integer.parseInt(fd);
} catch (NumberFormatException nfe) {
getLogger().warn("Error in number format with fraction-digits",
nfe);