From: Ranjit Mathew Date: Fri, 18 Jun 2004 13:53:19 +0000 (+0000) Subject: VMClassLoader.java (init): Add extensions directory only if it actually exists. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ca77e6fa4577b378a564bf95276e62158e2b4b6;p=gcc.git VMClassLoader.java (init): Add extensions directory only if it actually exists. * gnu/gcj/runtime/VMClassLoader.java (init): Add extensions directory only if it actually exists. From-SVN: r83347 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 965be17fb41..2d0ec4b553d 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-06-18 Ranjit Mathew + + * gnu/gcj/runtime/VMClassLoader.java (init): Add extensions + directory only if it actually exists. + 2004-06-18 Graydon Hoare * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java index 75d193b103c..5e7f4c8ea90 100644 --- a/libjava/gnu/gcj/runtime/VMClassLoader.java +++ b/libjava/gnu/gcj/runtime/VMClassLoader.java @@ -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) {