Browse Source

remove duplicate code

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@693732 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
35d8c0ef94
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      src/main/org/apache/tools/ant/taskdefs/Javac.java

+ 4
- 5
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -32,6 +32,7 @@ import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter;
import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.GlobPatternMapper;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.util.SourceFileScanner;
@@ -89,6 +90,8 @@ public class Javac extends MatchingTask {
private static final String PACKAGE_INFO_JAVA = "package-info.java";
private static final String PACKAGE_INFO_CLASS = "package-info.class";

private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();

private Path src;
private File destDir;
private Path compileClasspath;
@@ -1148,7 +1151,7 @@ public class Javac extends MatchingTask {
return true;
}
// return true if destDir contains the file
String rel = relativePath(srcDir, file);
String rel = FILE_UTILS.removeLeadingPath(srcDir, file);
File destFile = new File(destDir, rel);
File parent = destFile.getParentFile();
destFile = new File(parent, PACKAGE_INFO_CLASS);
@@ -1167,8 +1170,4 @@ public class Javac extends MatchingTask {
return false;
}

private String relativePath(File src, File file) {
return file.getAbsolutePath().substring(
src.getAbsolutePath().length() + 1);
}
}

Loading…
Cancel
Save