Revision: 6454
Author: [email protected]
Date: Fri Oct 23 12:30:47 2009
Log: Updated with c6451, Fix a fatal error when asserts are enabled and a  
locale specified in
@DefaultLocale is not in the current list of locales.

Patch by: jat
Review by: jlabanca
Merge by: fabbott


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

Modified:
  /branches/snapshot-2009.10.23-r6446/branch-info.txt
   
/branches/snapshot-2009.10.23-r6446/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
   
/branches/snapshot-2009.10.23-r6446/user/src/com/google/gwt/i18n/rebind/AbstractResource.java

=======================================
--- /branches/snapshot-2009.10.23-r6446/branch-info.txt Fri Oct 23 09:31:50  
2009
+++ /branches/snapshot-2009.10.23-r6446/branch-info.txt Fri Oct 23 12:30:47  
2009
@@ -6,3 +6,6 @@
  /branches/snapshot-2009.10.23-r6446 was created (r6447) as a straight copy  
from /trunk/@6446

  Merges:
+Cherrypicked c6451 with:
+  svn merge -c6451 https://google-web-toolkit.googlecode.com/svn/trunk .
+
=======================================
---  
/branches/snapshot-2009.10.23-r6446/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
      
Wed Jun 24 10:53:23 2009
+++  
/branches/snapshot-2009.10.23-r6446/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
      
Fri Oct 23 12:30:47 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 $
=======================================
---  
/branches/snapshot-2009.10.23-r6446/user/src/com/google/gwt/i18n/rebind/AbstractResource.java
    
Mon Oct  5 06:46:07 2009
+++  
/branches/snapshot-2009.10.23-r6446/user/src/com/google/gwt/i18n/rebind/AbstractResource.java
    
Fri Oct 23 12:30:47 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