From 72245569272f19cdf0052b3468de340a9759d346 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 6 Nov 2001 10:47:34 +0000 Subject: [PATCH] Only add directories as extdirs that actually exist. Submitted by: Constantine P Sapuntzakis push addExtdirs to Path. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269877 13f79535-47bb-0310-9956-ffa450edef68 --- .../compilers/DefaultCompilerAdapter.java | 32 +----------------- .../tools/ant/taskdefs/compilers/Gcj.java | 2 +- .../tools/ant/taskdefs/compilers/Jikes.java | 2 +- .../tools/ant/taskdefs/compilers/Jvc.java | 2 +- .../tools/ant/taskdefs/compilers/Kjc.java | 2 +- .../ant/taskdefs/rmic/DefaultRmicAdapter.java | 33 +------------------ src/main/org/apache/tools/ant/types/Path.java | 29 ++++++++++++++++ 7 files changed, 35 insertions(+), 67 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java index 30ba0f151..6cce50444 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java @@ -229,7 +229,7 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter { cp.append(bootclasspath); } if (extdirs != null) { - addExtdirsToClasspath(cp); + cp.addExtdirs(extdirs); } cp.append(classpath); cp.append(src); @@ -407,36 +407,6 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter { } } - /** - * Emulation of extdirs feature in java >= 1.2. - * This method adds all files in the given - * directories (but not in sub-directories!) to the classpath, - * so that you don't have to specify them all one by one. - * @param classpath - Path to append files to - */ - protected void addExtdirsToClasspath(Path classpath) { - if (extdirs == null) { - String extProp = System.getProperty("java.ext.dirs"); - if (extProp != null) { - extdirs = new Path(project, extProp); - } else { - return; - } - } - - String[] dirs = extdirs.list(); - for (int i=0; i= 1.2. - * This method adds all files in the given - * directories (but not in sub-directories!) to the classpath, - * so that you don't have to specify them all one by one. - * @param classpath - Path to append files to - */ - protected void addExtdirsToClasspath(Path classpath) { - Path extdirs = attributes.getExtdirs(); - if (extdirs == null) { - String extProp = System.getProperty("java.ext.dirs"); - if (extProp != null) { - extdirs = new Path(attributes.getProject(), extProp); - } else { - return; - } - } - - String[] dirs = extdirs.list(); - for (int i=0; i= 1.2. + * This method adds all files in the given + * directories (but not in sub-directories!) to the classpath, + * so that you don't have to specify them all one by one. + * @param classpath - Path to append files to + */ + public void addExtdirs(Path extdirs) { + if (extdirs == null) { + String extProp = System.getProperty("java.ext.dirs"); + if (extProp != null) { + extdirs = new Path(project, extProp); + } else { + return; + } + } + + String[] dirs = extdirs.list(); + for (int i=0; i