VMClassLoader.java (init): Add extensions directory only if it actually exists.
authorRanjit Mathew <rmathew@hotmail.com>
Fri, 18 Jun 2004 13:53:19 +0000 (13:53 +0000)
committerRanjit Mathew <rmathew@gcc.gnu.org>
Fri, 18 Jun 2004 13:53:19 +0000 (13:53 +0000)
        * gnu/gcj/runtime/VMClassLoader.java (init): Add extensions
        directory only if it actually exists.

From-SVN: r83347

libjava/ChangeLog
libjava/gnu/gcj/runtime/VMClassLoader.java

index 965be17fb4136b943b62c40a71a0df1738afda76..2d0ec4b553d25051fe0f34e5bb531c73edc7b9ce 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-18  Ranjit Mathew  <rmathew@hotmail.com>
+
+       * gnu/gcj/runtime/VMClassLoader.java (init): Add extensions
+       directory only if it actually exists.
+
 2004-06-18  Graydon Hoare  <graydon@redhat.com>
 
        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:
index 75d193b103cbaf89234432c1057dfd83a9fe4176..5e7f4c8ea906222c042b01425bf8ed53f126da9b 100644 (file)
@@ -67,19 +67,22 @@ public final class VMClassLoader extends java.net.URLClassLoader
        try
          {
            File dir = new File (dirname);
-           if (! dirname.endsWith (File.separator))
-               dirname = dirname + File.separator;
-           String files[] 
-             = dir.list (new FilenameFilter ()
-                         { 
-                           public boolean accept (File dir, String name)
-                           {
-                             return (name.endsWith (".jar") 
-                                     || name.endsWith (".zip"));
-                           }
-                         });
-           for (int i = files.length - 1; i >= 0; i--)
-             addURL(new URL("file", "", -1, dirname + files[i]));
+            if (dir.exists ())
+            {
+              if (! dirname.endsWith (File.separator))
+                  dirname = dirname + File.separator;
+              String files[] 
+                = dir.list (new FilenameFilter ()
+                            { 
+                              public boolean accept (File dir, String name)
+                              {
+                                return (name.endsWith (".jar") 
+                                        || name.endsWith (".zip"));
+                              }
+                            });
+              for (int i = files.length - 1; i >= 0; i--)
+                addURL(new URL("file", "", -1, dirname + files[i]));
+            }
          }
        catch (Exception x)
          {