This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Problems with gnu.gcj.text.LocaleData
- To: "Java at Gcc dot Gnu. Org" <java at gcc dot gnu dot org>
- Subject: Problems with gnu.gcj.text.LocaleData
- From: "Anthony Green" <green at redhat dot com>
- Date: Tue, 4 Sep 2001 07:17:14 -0700
Can we cache the resource bundles we attempt to load in java.text? In
debugging the core:/ protocol code yesterday, I noticed that some programs
frequently try to open files which are variations of gnu/gcj/text/LocaleData.
I'm talking about code like this in libjava/java/text/NumberFormat.java....
private static final NumberFormat computeInstance (Locale loc,
String resource,
String def)
{
ResourceBundle res;
try
{
res = ResourceBundle.getBundle("gnu.gcj.text.LocaleData", loc);
}
catch (MissingResourceException x)
{
res = null;
}
There's another problem here. java.util.ResouceBundle.getBundle says....
ResourceBundle baseBundle = tryBundle(baseName, new Locale("", ""),
classLoader, null, cache);
if (baseBundle == null)
// JDK says, that if one provides a bundle base_en_UK, one
// must also provide the bundles base_en and base.
// This implies that if there is no bundle for base, there
// is no bundle at all.
throw new MissingResourceException("Bundle not found", baseName, "");
However, we only provide gnu.gcj.text.LocaleData_en and
gnu.gcj.text.LocaleData_en_US, so these are never loaded.
AG