Reviewers: ,

Message:
Looking for a reviewer on this.

----

Note there are other uses of getBytes() without a specified encoding:
 - in XsrfProtectedServiceServlet and XsrfTokenServiceServlet (though
it's not that important, as it's about creating and validating a token;
it could be an issue only if you load-balance between instances that
don't run with the same file.encoding),
 - in RunAsyncfailureServlet in unit tests,
 - in StringTest in unit-tests; that one is expected.

Note also that all uses of new String() and getBytes() when a "String
charsetName" is passed could be changed to using "Charset charset",
resolving that one only once. According to
http://code.google.com/p/google-web-toolkit/source/detail?r=10933 that
could possibly speed things up (including maybe the compiler).
I'll leave that improvement to another CL.

Description:
ExternalTextResourceGenerator is locale/machine-dependent.

Fixes issue 5200


Please review this at https://gwt-code-reviews.appspot.com/1716804/

Affected files:
  M user/src/com/google/gwt/resources/rg/ExternalTextResourceGenerator.java


Index: user/src/com/google/gwt/resources/rg/ExternalTextResourceGenerator.java diff --git a/user/src/com/google/gwt/resources/rg/ExternalTextResourceGenerator.java b/user/src/com/google/gwt/resources/rg/ExternalTextResourceGenerator.java index 7bb445e67456669508b2bfd13c42843638652861..043075997136ed733dfa7f1c81aeb8dd652e6405 100644 --- a/user/src/com/google/gwt/resources/rg/ExternalTextResourceGenerator.java +++ b/user/src/com/google/gwt/resources/rg/ExternalTextResourceGenerator.java
@@ -105,7 +105,7 @@ public final class ExternalTextResourceGenerator extends

     urlExpression = context.deploy(
context.getClientBundleType().getQualifiedSourceName().replace('.', '_') - + "_jsonbundle.txt", "text/plain", wrappedData.toString().getBytes(), true); + + "_jsonbundle.txt", "text/plain", Util.getBytes(wrappedData.toString()), true);

     TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle();
     JClassType stringType = typeOracle.findType(String.class.getName());
@@ -171,7 +171,7 @@ public final class ExternalTextResourceGenerator extends
   }

   private String getMd5HashOfData() {
-    return Util.computeStrongName(data.toString().getBytes());
+    return Util.computeStrongName(Util.getBytes(data.toString()));
   }

private boolean shouldUseJsonp(ResourceContext context, TreeLogger logger) {


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

Reply via email to