For compatibility with linkers that don't yet understand soft
permutations, don't add a ":0" to the strong name of soft
permutation number 0.

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

Review by: jat@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7925 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java b/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
index cb62803..b241738 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
@@ -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");
           }
         }