bodewig 01/09/27 03:10:51
Modified: . Tag: ANT_14_BRANCH WHATSNEW
src/main/org/apache/tools/ant/util Tag: ANT_14_BRANCH
SourceFileScanner.java
Log:
deal with situations where the to-pattern of a mapper expands to an
absolute filename.
PR: 3568
Based on a patch by: Magesh Umasankar <[EMAIL PROTECTED]>
Revision Changes Path
No revision
No revision
1.144.2.14 +4 -1 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.144.2.13
retrieving revision 1.144.2.14
diff -u -r1.144.2.13 -r1.144.2.14
--- WHATSNEW 2001/09/26 14:53:31 1.144.2.13
+++ WHATSNEW 2001/09/27 10:10:51 1.144.2.14
@@ -19,8 +19,11 @@
* sql task now handles REM statements correctly so that lines starying with
rem
but which are not comments are actually processed.
-* XMLLogger no uses the task's name rather than the classname
+* XMLLogger now uses the task's name rather than the classname
+* <mapper>s will now work as expected if the to pattern expands to an
+ absolute pathname.
+
Other changes:
--------------
No revision
No revision
1.5.4.1 +5 -2
jakarta-ant/src/main/org/apache/tools/ant/util/SourceFileScanner.java
Index: SourceFileScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/SourceFileScanner.java,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -r1.5 -r1.5.4.1
--- SourceFileScanner.java 2000/11/29 14:42:49 1.5
+++ SourceFileScanner.java 2001/09/27 10:10:51 1.5.4.1
@@ -74,11 +74,14 @@
protected Task task;
+ private FileUtils fileUtils;
+
/**
* @param task The task we should log messages through
*/
public SourceFileScanner(Task task) {
this.task = task;
+ fileUtils = FileUtils.newFileUtils();
}
/**
@@ -118,7 +121,7 @@
continue;
}
- File src = new File(srcDir, files[i]);
+ File src = fileUtils.resolveFile(srcDir, files[i]);
if (src.lastModified() > now) {
task.log("Warning: "+files[i]+" modified in the future.",
Project.MSG_WARN);
@@ -131,7 +134,7 @@
if (destDir == null) {
dest = new File(targets[j]);
} else {
- dest = new File(destDir, targets[j]);
+ dest = fileUtils.resolveFile(destDir, targets[j]);
}
if (!dest.exists()) {