diff options
author | Brian Jones <cbj@gnu.org> | 2003-01-06 04:00:36 +0000 |
---|---|---|
committer | Brian Jones <cbj@gnu.org> | 2003-01-06 04:00:36 +0000 |
commit | 02797aea6678a9587a22d6e778836588ebac772c (patch) | |
tree | ea72770d75c4f738bfd807e3979eb9443f6d512f | |
parent | 5c3cd002dea04804847712529e7722ab6409533c (diff) | |
download | classpath-02797aea6678a9587a22d6e778836588ebac772c.tar.gz |
* THANKYOU: fixed Weldon's email reference
2003-01-05 Julian Dolby <dolby@us.ibm.com>
* java/util/ResourceBundle.java (tryBundle): If an exception
occurs, do not try to use the bundle.
* (static): initialize static reference to loaded ResourceBundle and
ResourceBundle$Security
* (getCallingClassLoader): Use new static references
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | THANKYOU | 2 | ||||
-rw-r--r-- | java/util/ResourceBundle.java | 23 |
3 files changed, 31 insertions, 5 deletions
@@ -1,3 +1,14 @@ +2003-01-05 C. Brian Jones <cbj@gnu.org> + + * THANKYOU: fixed Weldon's email reference + +2003-01-05 Julian Dolby <dolby@us.ibm.com> + * java/util/ResourceBundle.java (tryBundle): If an exception + occurs, do not try to use the bundle. + * (static): initialize static reference to loaded ResourceBundle and + ResourceBundle$Security + * (getCallingClassLoader): Use new static references + 2003-01-03 Mark Wielaard <mark@klomp.org> Merge with libgcj. @@ -43,7 +43,7 @@ Ian D. Stewart (idstewart@softhome.net) Jeff Sturm (jsturm@one-point.com) Sreenivas Subramoney (sreenivas.subramoney@intel.com) Chris Toshok (toshok@hungry.com) -Weldon Washburn (mailto:weldon.washburn@intel.com) +Weldon Washburn (weldon.washburn@intel.com) Adam Welc (welc@cs.purdue.edu) Gansha Wu (gansha.wu@intel.com) Shuhua Zhang (Shuhua.Zhang@echostar.com) diff --git a/java/util/ResourceBundle.java b/java/util/ResourceBundle.java index fa91a0a40..edc7328d2 100644 --- a/java/util/ResourceBundle.java +++ b/java/util/ResourceBundle.java @@ -105,6 +105,18 @@ public abstract class ResourceBundle */ private Locale locale; + private static Class resourceBundleClass; + private static Class securityClass; + + static { + try { + resourceBundleClass = Class.forName("java.util.ResourceBundle"); + securityClass = Class.forName("java.util.ResourceBundle$Security"); + } catch (ClassNotFoundException e) { + + } + } + /** * We override SecurityManager in order to access getClassContext(). */ @@ -124,9 +136,11 @@ public abstract class ResourceBundle ClassLoader getCallingClassLoader() { Class[] stack = getClassContext(); - for (int i = 0; i < stack.length; i++) - if (stack[i] != Security.class && stack[i] != ResourceBundle.class) + for (int i = 0; i < stack.length; i++) { + if (stack[i] != securityClass && stack[i] != resourceBundleClass) return stack[i].getClassLoader(); + } + return null; } } @@ -221,8 +235,8 @@ public abstract class ResourceBundle catch (MissingResourceException ex) { } - throw new MissingResourceException("Key not found", - getClass().getName(), key); + + throw new MissingResourceException("Key not found", getClass().getName(), key); } /** @@ -509,6 +523,7 @@ public abstract class ResourceBundle catch (Exception ex) { // ignore them all + foundBundle = null; } if (foundBundle == null) { |