Revision: 7928
Author: [email protected]
Date: Thu Apr 15 16:37:58 2010
Log: Cherrypicking r7925 from trunk:
svn merge --ignore-ancestry -r 7924:7925
https://google-web-toolkit.googlecode.com/svn/trunk .
This improves backward compatibility for the soft permutation changes.
http://code.google.com/p/google-web-toolkit/source/detail?r=7928
Modified:
/branches/snapshot-2010.03.29-r7809/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
=======================================
---
/branches/snapshot-2010.03.29-r7809/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
Thu Apr 15 16:36:50 2010
+++
/branches/snapshot-2010.03.29-r7809/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
Thu Apr 15 16:37:58 2010
@@ -362,12 +362,14 @@
} else if (propMapsByPermutation.size() == 1) {
// Just one distinct compilation; no need to evaluate properties
text.append("strongName = '"
- + propMapsByPermutation.keySet().iterator().next() + "';");
+ +
propMapsByPermutation.keySet().iterator().next().getStrongName()
+ + "';");
} else {
Set<String> propertiesUsed = new HashSet<String>();
for (PermutationId permutationId : propMapsByPermutation.keySet())
{
for (Map<String, String> propertyMap :
propMapsByPermutation.get(permutationId)) {
// unflatten([v1, v2, v3], 'strongName' + ':softPermId');
+ // The soft perm ID is concatenated to improve string interning
text.append("unflattenKeylistIntoAnswers([");
boolean needsComma = false;
for (SelectionProperty p : context.getProperties()) {
@@ -386,10 +388,17 @@
propertiesUsed.add(p.getName());
}
- // Concatenate the soft permutation id to improve string
interning
text.append("], '").append(permutationId.getStrongName()).append(
- "'
+ ':").append(permutationId.getSoftPermutationId()).append(
- "');\n");
+ "'");
+ /*
+ * For compatibility with older linkers, skip the soft
permutation
+ * if it's 0
+ */
+ if (permutationId.getSoftPermutationId() != 0) {
+ text.append("
+ ':").append(permutationId.getSoftPermutationId()).append(
+ "'");
+ }
+ text.append(");\n");
}
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors