Stabilize compiler output: Normalize timestamps if necessary.

Review by: cromwellian@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10809 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/javac/CachedCompilationUnit.java b/dev/core/src/com/google/gwt/dev/javac/CachedCompilationUnit.java
index a06a750..48b1f15 100644
--- a/dev/core/src/com/google/gwt/dev/javac/CachedCompilationUnit.java
+++ b/dev/core/src/com/google/gwt/dev/javac/CachedCompilationUnit.java
@@ -34,6 +34,9 @@
  * A convenient way to serialize a {@CompilationUnit}.
  */
 public class CachedCompilationUnit extends CompilationUnit {
+  private static final boolean normalizeTimestamps = Boolean.parseBoolean(
+      System.getProperty("gwt.normalizeTimestamps", "false"));
+
   private final DiskCacheToken astToken;
   private final long astVersion;
   private transient Collection<CompiledClass> compiledClasses;
@@ -76,7 +79,7 @@
     this.astVersion = unit.astVersion;
 
     // Override these fields
-    this.lastModified = lastModified;
+    this.lastModified = normalizeTimestamps ? 0 : lastModified;
   }
 
   /**
@@ -98,7 +101,7 @@
     this.resourcePath = unit.getResourcePath();
     this.resourceLocation = Util.stripJarPathPrefix(unit.getResourceLocation());
     this.jsniMethods = unit.getJsniMethods();
-    this.lastModified = unit.getLastModified();
+    this.lastModified = normalizeTimestamps ? 0 : unit.getLastModified();
     this.methodArgNamesLookup = unit.getMethodArgs();
     this.typeName = unit.getTypeName();
     this.isError = unit.isError();