ClassLoader.java (getSystemResource): Use getSystemClassLoader instead of ClassLoader...
authorAnthony Green <green@cygnus.com>
Sun, 17 Oct 1999 03:11:50 +0000 (03:11 +0000)
committerAnthony Green <green@gcc.gnu.org>
Sun, 17 Oct 1999 03:11:50 +0000 (03:11 +0000)
        * java/lang/ClassLoader.java (getSystemResource): Use
        getSystemClassLoader instead of ClassLoader.system.
        (getSystemResourceAsStream): Ditto.

        * java/lang/natClassLoader.cc (redirect): Make static and
        remove #ifdef INTERPRETER so it is always defined.
        (getVMClassLoader0): Remove #ifdef INTERPRETER so it always
        returns a VMClassLoader.

        * java/util/ResourceBundle.java (trySomeGetBundle): Create a
        PropertyResourceBundle if a properties file is found before a
        ResourceBundle class.

From-SVN: r30048

libjava/ChangeLog
libjava/java/lang/ClassLoader.java
libjava/java/lang/natClassLoader.cc
libjava/java/util/ResourceBundle.java

index 4f37d8a66f2499db7f516f661e3b9d915df87baa..0e6761c11ae8161080a96dc25b8e982f515560a0 100644 (file)
@@ -1,3 +1,18 @@
+1999-10-16  Anthony Green  <green@cygnus.com>
+
+       * java/lang/ClassLoader.java (getSystemResource): Use
+       getSystemClassLoader instead of ClassLoader.system.
+       (getSystemResourceAsStream): Ditto.
+
+       * java/lang/natClassLoader.cc (redirect): Make static and
+       remove #ifdef INTERPRETER so it is always defined.
+       (getVMClassLoader0): Remove #ifdef INTERPRETER so it always
+       returns a VMClassLoader.
+
+       * java/util/ResourceBundle.java (trySomeGetBundle): Create a
+       PropertyResourceBundle if a properties file is found before a
+       ResourceBundle class.
+
 1999-10-15  Tom Tromey  <tromey@cygnus.com>
 
        * gij.cc (main): Formatting fixes.
index 4d520bb6c199b4a93312150eb4affabb97dfd481..f04868d94e65ec83629d6f391a6f40a5855d7fdb 100644 (file)
@@ -360,11 +360,11 @@ public abstract class ClassLoader {
   protected native Class findLoadedClass(String name);
 
   public static final InputStream getSystemResourceAsStream(String name) {
-    return system.getResourceAsStream (name);
+    return getSystemClassLoader().getResourceAsStream (name);
   }
 
   public static final URL getSystemResource(String name) {
-    return system.getResource (name);
+    return getSystemClassLoader().getResource (name);
   }
 
   /**
index 9ad81a81a3711eebc60da2033ce0b3d9b25b0fa0..af4a4fab6321c3f7640dab3daf71d84060b37c4f 100644 (file)
@@ -48,20 +48,14 @@ extern java::lang::Class ClassLoaderClass;
 
 /////////// java.lang.ClassLoader native methods ////////////
 
-#ifdef INTERPRETER
-gnu::gcj::runtime::VMClassLoader *redirect = 0;
-#endif
+static gnu::gcj::runtime::VMClassLoader *redirect = 0;
 
 java::lang::ClassLoader*
 java::lang::ClassLoader::getVMClassLoader0 ()
 {
-#ifdef INTERPRETER
-    if (redirect == 0)
-       redirect = new gnu::gcj::runtime::VMClassLoader;
-    return redirect;
-#else
-    return 0;
-#endif
+  if (redirect == 0)
+    redirect = new gnu::gcj::runtime::VMClassLoader;
+  return redirect;
 }
 
 void
index 5a2002aabb6cce9e9f92dc6f805c8f1c678e2d2b..0c078cc1ee77ba7b6b6b8f9f40805cdb776312d0 100644 (file)
@@ -8,6 +8,8 @@ details.  */
 
 package java.util;
 
+import java.io.InputStream;
+
 /**
  * @author Anthony Green <green@cygnus.com>
  * @date November 26, 1998.
@@ -106,6 +108,23 @@ public abstract class ResourceBundle
              // Fall through.
            }
 
+         // Look for a properties file.
+         {
+           InputStream i = 
+               ClassLoader.getSystemResourceAsStream (bundleName.replace ('.', '/') 
+                                                      + ".properties");
+           if (i != null)
+             {
+               try {
+                 return new PropertyResourceBundle (i);
+               } catch (java.io.IOException e) {
+                 // The docs don't appear to define what happens in
+                 // this case, but it seems like continuing the
+                 // search is a reasonable thing to do.
+               }
+             }
+         }
+
          if (bundleName.equals(stopHere))
            return result;
          else