harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r997554 - in /harmony/enhanced/java/trunk/classlib: ./ depends/files/ depends/manifests/icu4j_4.2.1/META-INF/ depends/manifests/icu4j_4.4.1.1/ depends/manifests/icu4j_4.4.1.1/META-INF/ make/ modules/luni/src/main/java/java/util/ modules/lun...
Date Thu, 16 Sep 2010 01:26:19 GMT
Author: regisxu
Date: Thu Sep 16 01:26:18 2010
New Revision: 997554

URL: http://svn.apache.org/viewvc?rev=997554&view=rev
Log:
Apply patch for HARMONY-6617: [classlib]Upgrade ICU4J4.2.1 to ICU4J4.4.1.1

Added:
    harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.4.1.1/
    harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.4.1.1/META-INF/
    harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.4.1.1/META-INF/MANIFEST.MF
      - copied, changed from r997349, harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.2.1/META-INF/MANIFEST.MF
Removed:
    harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.2.1/META-INF/MANIFEST.MF
Modified:
    harmony/enhanced/java/trunk/classlib/build.xml
    harmony/enhanced/java/trunk/classlib/depends/files/bootclasspath.properties
    harmony/enhanced/java/trunk/classlib/make/depends.properties
    harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/util/Currency.java
    harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java

Modified: harmony/enhanced/java/trunk/classlib/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/build.xml?rev=997554&r1=997553&r2=997554&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/build.xml (original)
+++ harmony/enhanced/java/trunk/classlib/build.xml Thu Sep 16 01:26:18 2010
@@ -200,7 +200,7 @@ module:
         <!-- Copy across the boot dependency jars --><!-- TOFIX clean these? -->
         <copy todir="${hy.jdk}/jre/lib/boot">
             <fileset dir="${depends.jars}">
-                <patternset includes="icu4j_4.2.1/*.jar" />
+                <patternset includes="icu4j_4.4.1.1/*.jar" />
             </fileset>
             <fileset dir="${depends.manifests}"/>
         </copy>

Modified: harmony/enhanced/java/trunk/classlib/depends/files/bootclasspath.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/depends/files/bootclasspath.properties?rev=997554&r1=997553&r2=997554&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/depends/files/bootclasspath.properties (original)
+++ harmony/enhanced/java/trunk/classlib/depends/files/bootclasspath.properties Thu Sep 16
01:26:18 2010
@@ -161,8 +161,8 @@ bootclasspath.source.packageroot.30=/
 
 # ICU functionality for text/characters are provided by the ICU4J 
 # and ICU4J-charsets JAR files.
-bootclasspath.31=icu4j_4.2.1/icu4j-4_2_1.jar
-bootclasspath.32=icu4j_4.2.1/icu4j-charsets-4_2_1.jar
+bootclasspath.31=icu4j_4.4.1.1/icu4j-4_4_1_1.jar
+bootclasspath.32=icu4j_4.4.1.1/icu4j-charsets-4_4_1_1.jar
 
 # The following JARs are from Xerces/Xalan
 bootclasspath.34=xalan-j_2.7.0/xalan.jar

Copied: harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.4.1.1/META-INF/MANIFEST.MF
(from r997349, harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.2.1/META-INF/MANIFEST.MF)
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.4.1.1/META-INF/MANIFEST.MF?p2=harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.4.1.1/META-INF/MANIFEST.MF&p1=harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.2.1/META-INF/MANIFEST.MF&r1=997349&r2=997554&rev=997554&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.2.1/META-INF/MANIFEST.MF
(original)
+++ harmony/enhanced/java/trunk/classlib/depends/manifests/icu4j_4.4.1.1/META-INF/MANIFEST.MF
Thu Sep 16 01:26:18 2010
@@ -2,8 +2,8 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: ICU4J
 Bundle-SymbolicName: com.ibm.icu4j;singleton:=true
-Bundle-Version: 4.2.1
-Bundle-ClassPath: icu4j-4_2_1.jar,icu4j-charsets-4_2_1.jar
+Bundle-Version: 4.4.1.1
+Bundle-ClassPath: icu4j-4_4_1_1.jar,icu4j-charsets-4_4_1_1.jar
 Eclipse-JREBundle: true
 Import-Package: java.io,
  java.lang,

Modified: harmony/enhanced/java/trunk/classlib/make/depends.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/make/depends.properties?rev=997554&r1=997553&r2=997554&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/make/depends.properties (original)
+++ harmony/enhanced/java/trunk/classlib/make/depends.properties Thu Sep 16 01:26:18 2010
@@ -99,14 +99,14 @@ bcprov.jar=${bcprov.dir}/bcprov.jar
 bcprov.url=${depends.url}/jars/bcprov/${bcprov.ver}.jar
 bcprov.md5=2062f8e3d15748443ea60a94b266371c
 
-icu4j.ver=icu4j_4.2.1
+icu4j.ver=icu4j_4.4.1.1
 icu4j.dir=${depends.jars}/${icu4j.ver}
-icu4j.jar=${icu4j.dir}/icu4j-4_2_1.jar
-icu4j.url=http://download.icu-project.org/files/icu4j/4.2.1/icu4j-4_2_1.jar
-icu4j.md5=2bef290de1db6970a6699bf78f0dca77
+icu4j.jar=${icu4j.dir}/icu4j-4_4_1_1.jar
+icu4j.url=http://download.icu-project.org/files/icu4j/4.4.1.1/icu4j-4_4_1_1.jar
+icu4j.md5=52e1253e6c1c4124c4085e239e51a585
 
-icu4j-charsets.ver=icu4j_4.2.1
+icu4j-charsets.ver=icu4j_4.4.1.1
 icu4j-charsets.dir=${depends.jars}/${icu4j.ver}
-icu4j-charsets.jar=${icu4j.dir}/icu4j-charsets-4_2_1.jar
-icu4j-charsets.url=http://download.icu-project.org/files/icu4j/4.2.1/icu4j-charsets-4_2_1.jar
-icu4j-charsets.md5=bccab3c39d735171fb54ce5e4f49207b
+icu4j-charsets.jar=${icu4j.dir}/icu4j-charsets-4_4_1_1.jar
+icu4j-charsets.url=http://download.icu-project.org/files/icu4j/4.4.1.1/icu4j-charsets-4_4_1_1.jar
+icu4j-charsets.md5=d76e2861a01d427129f795223a610b2f

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/util/Currency.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/util/Currency.java?rev=997554&r1=997553&r2=997554&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/util/Currency.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/util/Currency.java
Thu Sep 16 01:26:18 2010
@@ -73,13 +73,11 @@ public final class Currency implements S
      */
     public static Currency getInstance(Locale locale) {
         com.ibm.icu.util.Currency currency = null;
-        try {
-            currency = com.ibm.icu.util.Currency.getInstance(locale);
-        } catch (IllegalArgumentException e) {
-            return null;
-        }
+        currency = com.ibm.icu.util.Currency.getInstance(locale);
+
         if (currency == null) {
-            throw new IllegalArgumentException(locale.getCountry());
+            checkCountry(locale.getCountry());
+            return null;
         }
         String currencyCode = currency.getCurrencyCode();
 
@@ -90,6 +88,15 @@ public final class Currency implements S
         return getInstance(currencyCode);
     }
 
+    private static void checkCountry(String country) {
+        String[] countries = Locale.getISOCountries();
+        List<String> countryArray = Arrays.asList(countries);
+
+        if (!countryArray.contains(country)) {
+            throw new IllegalArgumentException(country);
+        }
+    }
+
     /**
      * Returns this {@code Currency}'s ISO 4217 currency code.
      * 

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java?rev=997554&r1=997553&r2=997554&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ScannerTest.java
Thu Sep 16 01:26:18 2010
@@ -1117,7 +1117,7 @@ public class ScannerTest extends TestCas
             // expected
         }
 
-        s = new Scanner("-123 123- (123)");
+        s = new Scanner("-123 123-");
         s.useLocale(new Locale("mk", "MK"));
         assertEquals(-123, s.nextInt(10));
         try {
@@ -1128,8 +1128,6 @@ public class ScannerTest extends TestCas
         }
         // Skip the un-recognizable token 123-.
         assertEquals("123-", s.next());
-        // The following test case fails on RI
-        assertEquals(-123, s.nextInt(10));
 
         // If the parameter radix is illegal, the following test cases fail on
         // RI
@@ -1317,7 +1315,7 @@ public class ScannerTest extends TestCas
             // expected
         }
 
-        s = new Scanner("-123 123- (123)");
+        s = new Scanner("-123 123-");
         s.useLocale(new Locale("mk", "MK"));
         assertEquals(-123, s.nextInt());
         try {
@@ -1328,8 +1326,6 @@ public class ScannerTest extends TestCas
         }
         // Skip the un-recognizable token 123-.
         assertEquals("123-", s.next());
-        // The following test case fails on RI
-        assertEquals(-123, s.nextInt());
     }
     
     /**
@@ -1574,9 +1570,8 @@ public class ScannerTest extends TestCas
             // Expected
         }
 
-        s = new Scanner("(123) 123- -123");
+        s = new Scanner("123- -123");
         s.useLocale(new Locale("mk", "MK"));
-        assertEquals((float)-123.0, s.nextFloat());
         try {
             s.nextFloat();
             fail("Should throw InputMismatchException");
@@ -3451,7 +3446,7 @@ public class ScannerTest extends TestCas
             // expected
         }
 
-        s = new Scanner("-123 123- (123)");
+        s = new Scanner("-123 123-");
         s.useLocale(new Locale("mk", "MK"));
         assertTrue(s.hasNextInt(10));
         assertEquals(-123, s.nextInt(10));
@@ -3464,9 +3459,6 @@ public class ScannerTest extends TestCas
         }
         // Skip the un-recognizable token 123-.
         assertEquals("123-", s.next());
-        // The following test case fails on RI
-        assertTrue(s.hasNextInt(10));
-        assertEquals(-123, s.nextInt(10));
     }
 
     /**
@@ -3653,7 +3645,7 @@ public class ScannerTest extends TestCas
             // expected
         }
 
-        s = new Scanner("-123 123- (123)");
+        s = new Scanner("-123 123-");
         s.useLocale(new Locale("mk", "MK"));
         assertTrue(s.hasNextInt());
         assertEquals(-123, s.nextInt());
@@ -3665,9 +3657,6 @@ public class ScannerTest extends TestCas
         }
         // Skip the un-recognizable token 123-.
         assertEquals("123-", s.next());
-        // The following test case fails on RI
-        assertTrue(s.hasNextInt());
-        assertEquals(-123, s.nextInt());
     }
     
     /**
@@ -3775,10 +3764,8 @@ public class ScannerTest extends TestCas
 //            // Expected
 //        }
 
-        s = new Scanner("(123) 123- -123");
+        s = new Scanner("123- -123");
         s.useLocale(new Locale("mk", "MK"));
-        assertTrue(s.hasNextFloat());
-        assertEquals((float)-123.0, s.nextFloat());
         assertFalse(s.hasNextFloat());
         try {
             s.nextFloat();



Mime
View raw message