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]
Other format: [Raw text]

Re: MissingResourceException with Date under mingw port


> Eric>   static
> Eric>   {
> Eric>     gnu.java.locale.Calendar c = null;
> Eric>   }

I don't particularly care for this approach.
The correct general solution is to support some option
to specify classes that should be loaded.  The gcj
wrapper can easily mangle this into a '-u' linker option.

I don't understand how forcing gnu.java.locale.Calendar
to get loaded really helps since you're don't know which
locale you will need.  However, I suggest the following:

Add a static method to gnu.java.locale.Calendar:

   public static ResourceBundle getBundle(Locale locale)
   {
     // This can possibly be optimized.
     return getBundle("gnu.java.locale.Calendar", locale);
   }

and in Date.java replace getBundle calls:
   ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
by:
   ResourceBundle rb = gnu.java.locale.Calendar.getBundle(locale);
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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