rubys 00/02/27 11:13:57
Modified: src/main/org/apache/tools/ant/taskdefs Javac.java
Log:
Issue a warning if a java source is found to be modified in the future
relative to the clock on the current machine.
Revision Changes Path
1.8 +9 -0
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
Index: Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Javac.java 2000/02/27 01:47:46 1.7
+++ Javac.java 2000/02/27 19:13:56 1.8
@@ -252,12 +252,21 @@
*/
private void scanDir(File srcDir, File destDir, String files[]) {
+
+ long now = (new Date()).getTime();
+
for (int i = 0; i < files.length; i++) {
File srcFile = new File(srcDir, files[i]);
if (files[i].endsWith(".java")) {
File classFile = new File(destDir, files[i].substring(0,
files[i].indexOf(".java"))
+ ".class");
+
+ if (srcFile.lastModified() > now) {
+ project.log("Warning: file modified in the future: "
+
+ files[i], project.MSG_WARN);
+ }
+
if (srcFile.lastModified() > classFile.lastModified()) {
compileList.addElement(srcFile.getAbsolutePath());
}