From 2b607265f5dd1128c9892e351e9b56b0368e3e9b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 10 May 1999 08:58:54 +0000 Subject: [PATCH] ResourceBundle.java (partialGetBundle): Explicitly use locale.toString(). * java/util/ResourceBundle.java (partialGetBundle): Explicitly use locale.toString(). (getBundle): Don't explicitly throw null pointer exception. From-SVN: r26856 --- libjava/ChangeLog | 4 ++++ libjava/java/util/ResourceBundle.java | 9 +++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 0386adc8033..b7d54b391bf 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,9 @@ 1999-05-10 Tom Tromey + * java/util/ResourceBundle.java (partialGetBundle): Explicitly use + locale.toString(). + (getBundle): Don't explicitly throw null pointer exception. + * gnu/gcj/RawData.java: Added copyright header. * include/jni.h (_Jv_va_list): Always define as va_list. diff --git a/libjava/java/util/ResourceBundle.java b/libjava/java/util/ResourceBundle.java index 05503c619e9..2a11083b010 100644 --- a/libjava/java/util/ResourceBundle.java +++ b/libjava/java/util/ResourceBundle.java @@ -129,7 +129,9 @@ public abstract class ResourceBundle { ResourceBundle rb; - String bundleName = baseName + "_" + locale; + // Explicitly invoke locale.toString() to force a + // NullPointerException when required. + String bundleName = baseName + "_" + locale.toString(); // Check the cache. Object obj = resource_cache.get(bundleName); @@ -154,11 +156,6 @@ public abstract class ResourceBundle ResourceBundle rb; Class rbc; - // FIXME: We can't currently rely on NullPointerException being - // thrown when we invoke a method on a null object. - if (locale == null) - throw new NullPointerException (); - rb = partialGetBundle(baseName, locale, false); if (rb != null) return rb;