diff options
author | rmathew <rmathew@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-18 13:53:19 +0000 |
---|---|---|
committer | rmathew <rmathew@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-18 13:53:19 +0000 |
commit | 674f3b8fc13c3141f3e94ccfe5a63a7859c3f0c9 (patch) | |
tree | 8000761a25785537567773f76f746e8739e94e33 /libjava/gnu/gcj | |
parent | 2892f83350b6148929801317ea75dd7bf73be0a1 (diff) | |
download | gcc-674f3b8fc13c3141f3e94ccfe5a63a7859c3f0c9.tar.gz |
* gnu/gcj/runtime/VMClassLoader.java (init): Add extensions
directory only if it actually exists.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/gcj')
-rw-r--r-- | libjava/gnu/gcj/runtime/VMClassLoader.java | 29 |
1 files changed, 16 insertions, 13 deletions
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) { |