You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by cr...@apache.org on 2003/01/09 04:25:24 UTC

cvs commit: jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl CollectionResourcesBaseTestCase.java

craigmcc    2003/01/08 19:25:24

  Modified:    resources/src/java/org/apache/commons/resources/impl
                        CollectionResourcesBase.java
               resources/src/test/org/apache/commons/resources/impl
                        CollectionResourcesBaseTestCase.java
  Log:
  For compatibility with JDK 1.2 and 1.3, use the two- or three-arg constructor
  when creating new Locale instances.
  
  Rob, I think I got them all, but do not have 1.3 to check.  If you find any
  more, could you please point them out specifically?
  
  Submitted by:	Rob Leland <rleland at apache.org>
  
  Revision  Changes    Path
  1.2       +6 -6      jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/CollectionResourcesBase.java
  
  Index: CollectionResourcesBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/CollectionResourcesBase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CollectionResourcesBase.java	5 Jan 2003 03:29:57 -0000	1.1
  +++ CollectionResourcesBase.java	9 Jan 2003 03:25:24 -0000	1.2
  @@ -265,10 +265,10 @@
   
               list.add(locale);
               if (variantLength > 0) {
  -                list.add(new Locale(language, country));
  +                list.add(new Locale(language, country, ""));
               }
               if ((countryLength > 0) && (languageLength > 0)) {
  -                list.add(new Locale(language));
  +                list.add(new Locale(language, "", ""));
               }
               if ((languageLength > 0) || (countryLength > 0)) {
                   list.add(new Locale("", "", ""));
  
  
  
  1.2       +13 -13    jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/CollectionResourcesBaseTestCase.java
  
  Index: CollectionResourcesBaseTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/CollectionResourcesBaseTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CollectionResourcesBaseTestCase.java	5 Jan 2003 03:29:58 -0000	1.1
  +++ CollectionResourcesBaseTestCase.java	9 Jan 2003 03:25:24 -0000	1.2
  @@ -158,18 +158,18 @@
           expected = new ArrayList();
           expected.add(test);
           expected.add(new Locale("en", "US"));
  -        expected.add(new Locale("en"));
  -        expected.add(new Locale(""));
  +        expected.add(new Locale("en", ""));
  +        expected.add(new Locale("", ""));
           checkLocaleList(test, expected, cresources.getLocaleList(test));
   
           test = new Locale("en", "US");
           expected = new ArrayList();
           expected.add(test);
  -        expected.add(new Locale("en"));
  -        expected.add(new Locale(""));
  +        expected.add(new Locale("en", ""));
  +        expected.add(new Locale("", ""));
           checkLocaleList(test, expected, cresources.getLocaleList(test));
   
  -        test = new Locale("en");
  +        test = new Locale("en", "");
           expected = new ArrayList();
           expected.add(test);
           expected.add(new Locale(""));
  @@ -179,13 +179,13 @@
           expected = new ArrayList();
           expected.add(test);
           expected.add(new Locale("", "US"));
  -        expected.add(new Locale(""));
  +        expected.add(new Locale("", ""));
           checkLocaleList(test, expected, cresources.getLocaleList(test));
   
           test = new Locale("", "US");
           expected = new ArrayList();
           expected.add(test);
  -        expected.add(new Locale(""));
  +        expected.add(new Locale("", ""));
           checkLocaleList(test, expected, cresources.getLocaleList(test));
   
       }
  @@ -218,7 +218,7 @@
   
           Locale locale = null;
   
  -        locale = new Locale("en");
  +        locale = new Locale("en", "");
           assertEquals("en specific value",
                        "[en] SPECIFIC",
                        resources.getString("test.specific", locale, null));
  @@ -228,7 +228,7 @@
                        "[en_US] SPECIFIC",
                        resources.getString("test.specific", locale, null));
   
  -        locale = new Locale("fr");
  +        locale = new Locale("fr", "");
           assertEquals("fr specific value",
                        "[fr] SPECIFIC",
                        resources.getString("test.specific", locale, null));
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>