Revision: 6518
Author: [email protected]
Date: Wed Oct 28 12:39:55 2009
Log: tr...@6517 was merged into this branch
   Ensure MhtmlClientBundleGenerator#createResourceContext generates unique  
strong names
     svn merge --ignore-ancestry -c 6517  
http://google-web-toolkit.googlecode.com/svn/trunk/ .

Patch by: jlabanca


http://code.google.com/p/google-web-toolkit/source/detail?r=6518

Modified:
  /releases/2.0/branch-info.txt
   
/releases/2.0/user/src/com/google/gwt/resources/rebind/context/MhtmlClientBundleGenerator.java

=======================================
--- /releases/2.0/branch-info.txt       Wed Oct 28 11:49:34 2009
+++ /releases/2.0/branch-info.txt       Wed Oct 28 12:39:55 2009
@@ -85,3 +85,7 @@
    Bugfix in JavaToJavaScriptCompiler where it assumes  
PropertyOracle#getSelectionProperty can return null
      svn merge --ignore-ancestry -c 6515  
http://google-web-toolkit.googlecode.com/svn/trunk/ .

+tr...@6517 was merged into this branch
+  Ensure MhtmlClientBundleGenerator#createResourceContext generates unique  
strong names
+    svn merge --ignore-ancestry -c 6517  
http://google-web-toolkit.googlecode.com/svn/trunk/ .
+
=======================================
---  
/releases/2.0/user/src/com/google/gwt/resources/rebind/context/MhtmlClientBundleGenerator.java
   
Wed May 27 06:48:54 2009
+++  
/releases/2.0/user/src/com/google/gwt/resources/rebind/context/MhtmlClientBundleGenerator.java
   
Wed Oct 28 12:39:55 2009
@@ -31,6 +31,7 @@
  public class MhtmlClientBundleGenerator extends  
AbstractClientBundleGenerator {

    private static final String BUNDLE_EXTENSION = ".cache.txt";
+  private static int counter = 0;

    private MhtmlResourceContext resourceContext;
    private String partialPath;
@@ -42,10 +43,15 @@
          resourceBundleType);

      /*
+     * We use a counter to ensure that the generated resources have unique
+     * names. Previously we used the system time, but it sometimes led to  
non-
+     * unique names if subsequent calls happened within the same  
millisecond.
+     *
       * TODO: figure out how to make the filename stable based on actual  
content.
       */
+    counter++;
      partialPath =  
Util.computeStrongName(Util.getBytes(resourceBundleType.getQualifiedSourceName()
-        + System.currentTimeMillis()))
+        + counter))
          + BUNDLE_EXTENSION;
      resourceContext.setPartialPath(partialPath);


--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to