6533516: Warning needed for file with future time stamps
Reviewed-by: jjg, vromero
Contributed-by: paul.govereau@oracle.com
--- a/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Wed Feb 26 15:38:55 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Wed Feb 26 18:05:02 2014 -0800
@@ -71,6 +71,8 @@
}
this.name = name;
this.file = f;
+ if (f.lastModified() > System.currentTimeMillis())
+ fileManager.log.warning("file.from.future", f);
}
@Override
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Wed Feb 26 15:38:55 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Wed Feb 26 18:05:02 2014 -0800
@@ -1158,6 +1158,10 @@
compiler.misc.x.print.rounds=\
Round {0}:\n\tinput files: {1}\n\tannotations: {2}\n\tlast round: {3}
+# 0: file name
+compiler.warn.file.from.future=\
+ Modification date is in the future for file {0}
+
#####
## The following string will appear before all messages keyed as:
--- a/langtools/test/tools/javac/diags/examples.not-yet.txt Wed Feb 26 15:38:55 2014 -0800
+++ b/langtools/test/tools/javac/diags/examples.not-yet.txt Wed Feb 26 18:05:02 2014 -0800
@@ -110,4 +110,4 @@
compiler.warn.unknown.enum.constant # in bad class file
compiler.warn.unknown.enum.constant.reason # in bad class file
compiler.warn.override.equals.but.not.hashcode # when a class overrides equals but not hashCode method from Object
-
+compiler.warn.file.from.future # warning for future modification times on files