Treats last modified time of jar file entries differently for purposes of computing staleness in the Compilation Unit Caches.  The timestamp of the .jar file is now used instead of the entries timestamps in the zip file format.  Some environments return time values out of sync with the local clock, foiling the staleness computation.

Review at http://gwt-code-reviews.appspot.com/1422802


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10051 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java b/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java
index c4bee98..af62c83 100644
--- a/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java
+++ b/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java
@@ -105,12 +105,13 @@
   private final Map<PathPrefixSet, ZipFileSnapshot> cachedSnapshots = new ReferenceIdentityMap(
       AbstractReferenceMap.WEAK, AbstractReferenceMap.HARD, true);
 
+  private final long lastModified;
   private final String location;
-
   private final ZipFile zipFile;
 
   private ZipFileClassPathEntry(File zipFile) throws IOException {
     assert zipFile.isAbsolute();
+    this.lastModified = zipFile.lastModified();
     this.zipFile = new ZipFile(zipFile);
     this.location = zipFile.toURI().toString();
   }
@@ -140,6 +141,10 @@
     return zipFile;
   }
 
+  public long lastModified() {
+    return lastModified;
+  }
+
   synchronized void index(TreeLogger logger) {
     // Never re-index.
     if (allZipFileResources == null) {
@@ -163,7 +168,7 @@
         continue;
       }
       ZipFileResource zipResource = new ZipFileResource(this,
-          zipEntry.getName(), zipEntry.getTime());
+          zipEntry.getName());
       results.add(zipResource);
       Messages.READ_ZIP_ENTRY.log(logger, zipEntry.getName(), null);
     }
diff --git a/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java b/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java
index 2f659b0..2e420cc 100644
--- a/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java
+++ b/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java
@@ -30,13 +30,11 @@
   private final ZipFileClassPathEntry classPathEntry;
   private final String path;
   private final String[] pathParts;
-  private long lastModified;
 
-  public ZipFileResource(ZipFileClassPathEntry classPathEntry, String path, long lastModified) {
+  public ZipFileResource(ZipFileClassPathEntry classPathEntry, String path) {
     this.classPathEntry = classPathEntry;
     this.path = StringInterner.get().intern(path);
     this.pathParts = Strings.splitPath(path);
-    this.lastModified = lastModified;
   }
 
   @Override
@@ -44,9 +42,13 @@
     return classPathEntry;
   }
 
+  /**
+   * Returns the lastModified time of the zip file itself.  Some build environments contain zip file
+   * entries that are not time synchronized, causing problems with staleness calculations.
+   */
   @Override
   public long getLastModified() {
-    return lastModified;
+    return classPathEntry.lastModified();
   }
 
   @Override