1 |
/* ResourceBundle -- aids in loading resource bundles |
/* ResourceBundle -- aids in loading resource bundles |
2 |
Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004 |
3 |
|
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
6 |
|
|
39 |
|
|
40 |
package java.util; |
package java.util; |
41 |
|
|
42 |
|
import java.io.IOException; |
43 |
|
import java.io.InputStream; |
44 |
import java.lang.ref.Reference; |
import java.lang.ref.Reference; |
45 |
import java.lang.ref.SoftReference; |
import java.lang.ref.SoftReference; |
|
import java.io.InputStream; |
|
|
import java.io.IOException; |
|
46 |
import java.security.AccessController; |
import java.security.AccessController; |
47 |
import java.security.PrivilegedAction; |
import java.security.PrivilegedAction; |
48 |
|
|
471 |
* @param bundle the backup (parent) bundle |
* @param bundle the backup (parent) bundle |
472 |
* @return the resource bundle if it was loaded, otherwise the backup |
* @return the resource bundle if it was loaded, otherwise the backup |
473 |
*/ |
*/ |
474 |
private static final ResourceBundle tryBundle(String localizedName, |
private static ResourceBundle tryBundle(String localizedName, Locale locale, |
475 |
Locale locale, |
ClassLoader classloader, |
476 |
ClassLoader classloader, |
ResourceBundle bundle, HashMap cache) |
|
ResourceBundle bundle, |
|
|
HashMap cache) |
|
477 |
{ |
{ |
478 |
// First look into the cache. |
// First look into the cache. |
479 |
if (cache.containsKey(localizedName)) |
if (cache.containsKey(localizedName)) |
563 |
* @param bundle the backup (parent) bundle |
* @param bundle the backup (parent) bundle |
564 |
* @return the resource bundle if it was loaded, otherwise the backup |
* @return the resource bundle if it was loaded, otherwise the backup |
565 |
*/ |
*/ |
566 |
private static final ResourceBundle tryLocalBundle(String baseName, |
private static ResourceBundle tryLocalBundle(String baseName, Locale locale, |
567 |
Locale locale, |
ClassLoader classloader, |
568 |
ClassLoader classloader, |
ResourceBundle bundle, |
569 |
ResourceBundle bundle, |
HashMap cache) |
|
HashMap cache) |
|
570 |
{ |
{ |
571 |
final String language = locale.getLanguage(); |
final String language = locale.getLanguage(); |
572 |
final String country = locale.getCountry(); |
final String country = locale.getCountry(); |