From c2007a8479b85ab1900be1b8b1f541d91024c53e Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Wed, 9 Aug 2000 14:09:49 +0000 Subject: [PATCH] Move addExisting functionality from javac to Path Fix error in Path constructor git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267905 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/Javac.java | 39 +++---------------- src/main/org/apache/tools/ant/types/Path.java | 25 +++++++++++- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Javac.java b/src/main/org/apache/tools/ant/taskdefs/Javac.java index 383d0cc82..2e3c515e2 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Javac.java +++ b/src/main/org/apache/tools/ant/taskdefs/Javac.java @@ -387,32 +387,29 @@ public class Javac extends MatchingTask { // add our classpath to the mix if (compileClasspath != null) { - addExistingToClasspath(classpath,compileClasspath); + classpath.addExisting(compileClasspath); } addReferencesToPath(classpathReferences, classpath); // add the system classpath - addExistingToClasspath(classpath, Path.systemClasspath); + classpath.addExisting(Path.systemClasspath); if (addRuntime) { if (Project.getJavaVersion() == Project.JAVA_1_1) { - addExistingToClasspath(classpath, - new Path(null, + classpath.addExisting(new Path(null, System.getProperty("java.home") + File.separator + "lib" + File.separator + "classes.zip")); } else { // JDK > 1.1 seems to set java.home to the JRE directory. - addExistingToClasspath(classpath, - new Path(null, + classpath.addExisting(new Path(null, System.getProperty("java.home") + File.separator + "lib" + File.separator + "rt.jar")); // Just keep the old version as well and let addExistingToPath // sort it out. - addExistingToClasspath(classpath, - new Path(null, + classpath.addExisting(new Path(null, System.getProperty("java.home") + File.separator +"jre" + File.separator + "lib" @@ -423,32 +420,6 @@ public class Javac extends MatchingTask { return classpath; } - - /** - * Takes a Path, and adds each element of - * another Path to a new classpath, if the components exist. - * Components that don't exist, aren't added. - * We do this, because jikes issues warnings for non-existant - * files/dirs in his classpath, and these warnings are pretty - * annoying. - * @param target - target classpath - * @param source - source classpath - * to get file objects. - */ - private void addExistingToClasspath(Path target, Path source) { - String[] list = source.list(); - for (int i=0; i