You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by la...@apache.org on 2002/03/22 19:46:30 UTC
cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/res StringManager.java
larryi 02/03/22 10:46:30
Modified: util/java/org/apache/tomcat/util/res StringManager.java
Log:
Finish sync'ing to Tomcat 3.3.x code. The code for j-t-c and j-t util classes
are now the same, though minor source differences remain.
Revision Changes Path
1.2 +21 -9 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/res/StringManager.java
Index: StringManager.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/res/StringManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StringManager.java 16 May 2001 23:18:17 -0000 1.1
+++ StringManager.java 22 Mar 2002 18:46:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
- * $Id: StringManager.java,v 1.1 2001/05/16 23:18:17 seguin Exp $
+ * $Id: StringManager.java,v 1.2 2002/03/22 18:46:30 larryi Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -82,7 +82,7 @@
* <p>Please see the documentation for java.util.ResourceBundle for
* more information.
*
- * @version $Revision: 1.1 $ $Date: 2001/05/16 23:18:17 $
+ * @version $Revision: 1.2 $ $Date: 2002/03/22 18:46:30 $
*
* @author James Duncan Davidson [duncan@eng.sun.com]
* @author James Todd [gonzo@eng.sun.com]
@@ -108,12 +108,7 @@
*/
private StringManager(String packageName) {
- String bundleName = packageName + ".LocalStrings";
- try {
- bundle = ResourceBundle.getBundle(bundleName);
- } catch( MissingResourceException ex ) {
- bundle= ResourceBundle.getBundle( bundleName, Locale.US);
- }
+ this( packageName, Locale.getDefault() );
}
private StringManager(String packageName,Locale loc) {
@@ -125,6 +120,11 @@
}
}
+ private StringManager(ResourceBundle bundle )
+ {
+ this.bundle=bundle;
+ }
+
/**
Get a string from the underlying resource bundle or return
null if the String is not found.
@@ -291,7 +291,19 @@
}
return mgr;
}
- /**
+
+ /**
+ * Get the StringManager for a particular package. If a manager for
+ * a package already exists, it will be reused, else a new
+ * StringManager will be created and returned.
+ *
+ * @param packageName
+ */
+ public synchronized static StringManager getManager(ResourceBundle bundle) {
+ return new StringManager( bundle );
+ }
+
+ /**
* Get the StringManager for a particular package and Locale. If a manager for
* a package already exists, it will be reused, else a new
* StringManager will be created for that Locale and returned.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>