This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problems with gnu.gcj.text.LocaleData


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]