Revision: 6453
Author: [email protected]
Date: Fri Oct 23 11:37:32 2009
Log: Merge r6451 from trunk to the release branch.

Fixes a fatal error on @DefaultLocale("foo") when foo is not in the locale  
list

     svn merge --ignore-ancestry -c6451 \
       https://google-web-toolkit.googlecode.com/svn/trunk/ .


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

Modified:
  /releases/2.0/branch-info.txt
   
/releases/2.0/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
  /releases/2.0/user/src/com/google/gwt/i18n/rebind/AbstractResource.java

=======================================
--- /releases/2.0/branch-info.txt       Tue Oct 20 22:17:45 2009
+++ /releases/2.0/branch-info.txt       Fri Oct 23 11:37:32 2009
@@ -21,3 +21,8 @@

  tr...@6437 was merged into this branch, Fixes a couple of build-breaking,  
checkstyle violations
      svn merge --ignore-ancestry -c 6437  
https://google-web-toolkit.googlecode.com/svn/trunk/ .
+
+tr...@6451 was merged into this branch
+ Fixes b/2198041, @DefaultLocale("foo") when foo is not in the locale list
+    svn merge --ignore-ancestry -c6451 \
+      https://google-web-toolkit.googlecode.com/svn/trunk/ .
=======================================
---  
/releases/2.0/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
    
Wed Jun 24 10:53:23 2009
+++  
/releases/2.0/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
    
Fri Oct 23 11:37:32 2009
@@ -109,7 +109,8 @@

      // generated implementations for interface X will be named X_, X_en,
      // X_en_CA, etc.
-    GwtLocale generatedLocale =  
resourceList.findLeastDerivedLocale(locale);
+    GwtLocale generatedLocale = resourceList.findLeastDerivedLocale(logger,
+        locale);
      String localeSuffix = String.valueOf(ResourceFactory.LOCALE_SEPARATOR);
      localeSuffix += generatedLocale.getAsString();
      // Use _ rather than "." in class name, cannot use $
=======================================
--- /releases/2.0/user/src/com/google/gwt/i18n/rebind/AbstractResource.java     
 
Mon Oct  5 06:46:07 2009
+++ /releases/2.0/user/src/com/google/gwt/i18n/rebind/AbstractResource.java     
 
Fri Oct 23 11:37:32 2009
@@ -132,11 +132,12 @@
      /**
       * From the list of locales matched for any resources in this resource  
list,
       * choose the one that is least derived from the original search  
locale.
-     *
+     * @param logger logger to use
       * @param locale originally requested locale
       * @return least derived matched locale
       */
-    public GwtLocale findLeastDerivedLocale(GwtLocale locale) {
+    public GwtLocale findLeastDerivedLocale(TreeLogger logger,
+        GwtLocale locale) {
        List<GwtLocale> searchList = locale.getCompleteSearchList();
        Map<GwtLocale, Integer> derivedIndex = new HashMap<GwtLocale,  
Integer>();
        for (int i = 0; i < searchList.size(); ++i) {
@@ -148,8 +149,8 @@
          GwtLocale matchLocale = list.get(i).getMatchLocale();
          Integer wrappedIdx = derivedIndex.get(matchLocale);
          if (wrappedIdx == null) {
-          assert false : "Locale " + matchLocale + " not in searchlist "
-              + searchList;
+          logger.log(TreeLogger.WARN, "Locale " + matchLocale
+              + " not in searchlist " + searchList);
            continue;
          }
          int idx = wrappedIdx;

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

Reply via email to