antoine 2003/05/24 06:52:49
Modified: src/main/org/apache/tools/ant/types/selectors
DifferentSelector.java
docs/manual/CoreTypes selectors.html
Log:
While reviewing this contribution, I saw that the original test in line 120
of DifferentSelector.java :
if(sameDate && !ignoreFileTimes) {
return true;
}
was wrong. I changed it to if (!sameDate) {
return true;
}
Also, DifferentSelector has no Junit test yet, this should be done.
PR: 20205
Submitted by: Jeff Turner (jefft at apache dot org)
Revision Changes Path
1.4 +9 -7
ant/src/main/org/apache/tools/ant/types/selectors/DifferentSelector.java
Index: DifferentSelector.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/DifferentSelector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DifferentSelector.java 10 Feb 2003 14:14:35 -0000 1.3
+++ DifferentSelector.java 24 May 2003 13:52:49 -0000 1.4
@@ -110,14 +110,16 @@
return true;
}
- //same date if dest timestamp is within granularity of the srcfile
- boolean sameDate;
- sameDate = destfile.lastModified() >= srcfile.lastModified() -
granularity
- && destfile.lastModified() <= srcfile.lastModified() +
granularity;
+ if (!ignoreFileTimes) {
+ //same date if dest timestamp is within granularity of the
srcfile
+ boolean sameDate;
+ sameDate = destfile.lastModified() >= srcfile.lastModified() -
granularity
+ && destfile.lastModified() <= srcfile.lastModified() +
granularity;
- //and when ignoreFileTimes is set we claim the files are now equal
- if(sameDate && !ignoreFileTimes) {
- return true;
+ // different dates => different files
+ if(!sameDate) {
+ return true;
+ }
}
//here do a bulk comparison
1.11 +1 -1 ant/docs/manual/CoreTypes/selectors.html
Index: selectors.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTypes/selectors.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- selectors.html 14 Apr 2003 07:53:07 -0000 1.10
+++ selectors.html 24 May 2003 13:52:49 -0000 1.11
@@ -320,7 +320,7 @@
<tr>
<td valign="top">ignoreFileTimes</td>
<td valign="top">Whether to use file times in the comparison or not.
- Default is true.
+ Default is false (time differences are significant).
</td>
<td valign="top" align="center">No</td>
</tr>