diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java index 88ecba085..522aa9047 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java @@ -560,32 +560,39 @@ public class JDependTask extends Task { } if (getSourcespath() != null) { - // This is deprecated - use classespath in the future - String[] sourcesPath = getSourcespath().list(); - for (int i = 0; i < sourcesPath.length; i++) { - File f = new File(sourcesPath[i]); - - // not necessary as JDepend would fail, but why loose some time? - if (!f.exists() || !f.isDirectory()) { - throw new BuildException("\"" + f.getPath() + "\" does not " - + "represent a valid directory. JDepend would fail."); + // This is deprecated - use classespath in the future + String[] sourcesPath = getSourcespath().list(); + for (int i = 0; i < sourcesPath.length; i++) { + File f = new File(sourcesPath[i]); + + // not necessary as JDepend would fail, but why loose + // some time? + if (!f.exists() || !f.isDirectory()) { + throw new BuildException("\"" + f.getPath() + + "\" does not represent a valid" + + " directory. JDepend would" + + " fail."); + } + commandline.createArgument().setValue(f.getPath()); } - commandline.createArgument().setValue(f.getPath()); - } } if (getClassespath() != null) { - // This is the new way - use classespath - code is the same for now - String[] classesPath = getClassespath().list(); - for (int i = 0; i < classesPath.length; i++) { - File f = new File(classesPath[i]); - // not necessary as JDepend would fail, but why loose some time? - if (!f.exists() || !f.isDirectory()) { - throw new BuildException("\"" + f.getPath() + "\" does not " - + "represent a valid directory. JDepend would fail."); + // This is the new way - use classespath - code is the + // same for now + String[] classesPath = getClassespath().list(); + for (int i = 0; i < classesPath.length; i++) { + File f = new File(classesPath[i]); + // not necessary as JDepend would fail, but why loose + // some time? + if (!f.exists() || !f.isDirectory()) { + throw new BuildException("\"" + f.getPath() + + "\" does not represent a valid" + + " directory. JDepend would" + + " fail."); + } + commandline.createArgument().setValue(f.getPath()); } - commandline.createArgument().setValue(f.getPath()); - } } Execute execute = new Execute(new LogStreamHandler(this,