Fix the test breakage by splitting the overrides intended to be part of the GWT-supplied
data and that expected to be written by the user.  Aside from fixing issues related to
order of classpath entries, this keeps the user from having to update their own overrides
if we update ours.

Patch by: jat
Review by: fabbott (TBR), robertvawter (TBR)



git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1867 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/i18n/client/cldr/LocaleNativeDisplayNames-override.properties b/user/src/com/google/gwt/i18n/client/cldr/LocaleNativeDisplayNames-manual.properties
similarity index 100%
rename from user/src/com/google/gwt/i18n/client/cldr/LocaleNativeDisplayNames-override.properties
rename to user/src/com/google/gwt/i18n/client/cldr/LocaleNativeDisplayNames-manual.properties
diff --git a/user/src/com/google/gwt/i18n/rebind/LocaleInfoGenerator.java b/user/src/com/google/gwt/i18n/rebind/LocaleInfoGenerator.java
index 061cb53..a83f17e 100644
--- a/user/src/com/google/gwt/i18n/rebind/LocaleInfoGenerator.java
+++ b/user/src/com/google/gwt/i18n/rebind/LocaleInfoGenerator.java
@@ -47,6 +47,14 @@
    */
   private static final String GENERATED_LOCALE_NATIVE_DISPLAY_NAMES =
       "com/google/gwt/i18n/client/cldr/LocaleNativeDisplayNames-generated.properties";
+  
+  /**
+   * Properties file containing hand-made corrections to the machine-generated
+   * locale display names above.
+   */
+  private static final String MANUAL_LOCALE_NATIVE_DISPLAY_NAMES =
+      "com/google/gwt/i18n/client/cldr/LocaleNativeDisplayNames-manual.properties";
+
   /**
    * Properties file containing hand-made overrides of locale display names,
    * in their native locales (if possible).
@@ -132,6 +140,7 @@
       writer.println("  }");
       writer.println("  this.@" + qualName + "::nativeDisplayNames = {");
       LocalizedProperties displayNames = new LocalizedProperties();
+      LocalizedProperties displayNamesManual = new LocalizedProperties();
       LocalizedProperties displayNamesOverride = new LocalizedProperties();
       ClassLoader classLoader = getClass().getClassLoader();
       try {
@@ -139,6 +148,10 @@
         if (str != null) {
           displayNames.load(str, "UTF-8");
         }
+        str = classLoader.getResourceAsStream(MANUAL_LOCALE_NATIVE_DISPLAY_NAMES);
+        if (str != null) {
+          displayNamesManual.load(str, "UTF-8");
+        }
         str = classLoader.getResourceAsStream(OVERRIDE_LOCALE_NATIVE_DISPLAY_NAMES);
         if (str != null) {
           displayNamesOverride.load(str, "UTF-8");
@@ -155,6 +168,9 @@
       for (String propval : localeValues) {
         String displayName = displayNamesOverride.getProperty(propval);
         if (displayName == null) {
+          displayName = displayNamesManual.getProperty(propval);
+        }
+        if (displayName == null) {
           displayName = displayNames.getProperty(propval);
         }
         if (displayName != null && displayName.length() != 0) {