harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r442428 - in /incubator/harmony/enhanced/classlib/trunk: depends/manifests/icu4j_3.4.4/ depends/manifests/icu4j_3.4.4/META-INF/ modules/luni/META-INF/ modules/luni/src/main/java/java/lang/ modules/luni/src/test/java/org/apache/harmony/luni/...
Date Tue, 12 Sep 2006 02:57:50 GMT
Author: ndbeyer
Date: Mon Sep 11 19:57:50 2006
New Revision: 442428

URL: http://svn.apache.org/viewvc?view=rev&rev=442428
Log:
Apply modified patch of HARMONY-1418: "[classlib][luni]implement new methods isDefined(int),isDigit(int),isLetter(int),isLetterOrDigit(int),isLowerCase(int),isUpperCase(int)
in java.lang.Character" and add ICU4J manifest to enable patch.

Added:
    incubator/harmony/enhanced/classlib/trunk/depends/manifests/icu4j_3.4.4/
    incubator/harmony/enhanced/classlib/trunk/depends/manifests/icu4j_3.4.4/META-INF/
    incubator/harmony/enhanced/classlib/trunk/depends/manifests/icu4j_3.4.4/META-INF/MANIFEST.MF
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java

Added: incubator/harmony/enhanced/classlib/trunk/depends/manifests/icu4j_3.4.4/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/depends/manifests/icu4j_3.4.4/META-INF/MANIFEST.MF?view=auto&rev=442428
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/depends/manifests/icu4j_3.4.4/META-INF/MANIFEST.MF
(added)
+++ incubator/harmony/enhanced/classlib/trunk/depends/manifests/icu4j_3.4.4/META-INF/MANIFEST.MF
Mon Sep 11 19:57:50 2006
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Harmony ICU4J
+Bundle-SymbolicName: org.apache.harmony.icu4j
+Bundle-Version: 3.4.4
+Bundle-ClassPath: icu4j_3_4_4.jar
+Eclipse-JREBundle: true
+Export-Package: com.ibm.icu,
+ com.ibm.icu.util,
+ com.ibm.icu.text,
+ com.ibm.icu.math,
+ com.ibm.icu.lang

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF?view=diff&rev=442428&r1=442427&r2=442428
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF Mon Sep 11
19:57:50 2006
@@ -7,7 +7,8 @@
 Eclipse-JREBundle: true
 Eclipse-ExtensibleAPI: true
 Specification-Title: Java Platform API Specification
-Import-Package: java.lang.annotation,
+Import-Package: com.ibm.icu.lang,
+ java.lang.annotation,
  java.math,
  java.nio,
  java.nio.channels,
@@ -22,11 +23,11 @@
  javax.net.ssl,
  javax.xml.parsers,
  org.apache.harmony.nio,
+ org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,
  org.w3c.dom,
  org.xml.sax,
  tests.support;hy_usage=test;resolution:=optional,
  tests.support.resource;hy_usage=test;resolution:=optional,
- org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,
  tests.util;hy_usage=test;resolution:=optional
 Export-Package: java.io,
  java.lang,

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java?view=diff&rev=442428&r1=442427&r2=442428
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
Mon Sep 11 19:57:50 2006
@@ -1,4 +1,4 @@
-/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+/* Copyright 1998, 2006 The Apache Software Foundation or its licensors, as applicable
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,8 @@
 
 import org.apache.harmony.luni.util.BinarySearch;
 
+import com.ibm.icu.lang.UCharacter;
+
 /**
  * <p>
  * Character is the wrapper for the primitive type <code>char</code>. This
@@ -2591,6 +2593,19 @@
 	public static boolean isDefined(char c) {
 		return getType(c) != UNASSIGNED;
 	}
+    
+    /**
+     * Answers whether the specified character is defined in the Unicode
+     * specification.
+     * 
+     * @param codePoint
+     *            the character, including supplementary characters
+     * @return true if the general Unicode category of the character is not
+     *         UNASSIGNED, false otherwise
+     */
+    public static boolean isDefined(int codePoint) {
+        return UCharacter.isDefined(codePoint);
+    }
 
 	/**
 	 * Answers whether the character is a digit.
@@ -2609,6 +2624,17 @@
         }
 		return getType(c) == DECIMAL_DIGIT_NUMBER;
 	}
+    
+    /**
+     * Answers whether the character is a digit.
+     * 
+     * @param codePoint
+     *            the character, including supplementary characters
+     * @return true when the character is a digit, false otherwise
+     */
+    public static boolean isDigit(int codePoint) {
+        return UCharacter.isDigit(codePoint);
+    }
 
 	/**
 	 * Answers whether the specified character is ignorable in a Java or Unicode
@@ -2639,7 +2665,7 @@
 	 * Answers whether the character is an ISO control character.
 	 * 
 	 * @param c
-	 *            the character,, including supplementary characters
+	 *            the character, including supplementary characters
 	 * @return <code>true</code> if <code>c</code> is an ISO control
 	 *         character, otherwise <code>false</code>
 	 */
@@ -2728,6 +2754,17 @@
 		int type = getType(c);
 		return type >= UPPERCASE_LETTER && type <= OTHER_LETTER;
 	}
+    
+    /**
+     * Answers whether the character is a letter.
+     * 
+     * @param codePoint
+     *            the character, including supplementary characters
+     * @return true when the character is a letter, false otherwise
+     */
+    public static boolean isLetter(int codePoint) {
+        return UCharacter.isLetter(codePoint);
+    }
 
 	/**
 	 * Answers whether the character is a letter or a digit.
@@ -2741,6 +2778,17 @@
 		return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER)
 				|| type == DECIMAL_DIGIT_NUMBER;
 	}
+    
+    /**
+     * Answers whether the character is a letter or a digit.
+     * 
+     * @param codePoint
+     *            the character, including supplementary characters
+     * @return true when the character is a letter or a digit, false otherwise
+     */
+    public static boolean isLetterOrDigit(int codePoint) {
+        return UCharacter.isLetterOrDigit(codePoint);
+    }
 
 	/**
 	 * Answers whether the character is a lower case letter.
@@ -2760,6 +2808,17 @@
 
 		return getType(c) == LOWERCASE_LETTER;
 	}
+    
+    /**
+     * Answers whether the character is a lower case letter.
+     * 
+     * @param codePoint
+     *            the character, including supplementary characters
+     * @return true when the character is a lower case letter, false otherwise
+     */
+    public static boolean isLowerCase(int codePoint) {
+        return UCharacter.isLowerCase(codePoint);
+    }
 
 	/**
 	 * Answers whether the character is a Java space.
@@ -2866,6 +2925,17 @@
 
 		return getType(c) == UPPERCASE_LETTER;
 	}
+    
+    /**
+     * Answers whether the character is an upper case letter.
+     * 
+     * @param codePoint
+     *            the character, including supplementary characters
+     * @return true when the character is a upper case letter, false otherwise
+     */
+    public static boolean isUpperCase(int codePoint) {
+        return UCharacter.isUpperCase(codePoint);
+    }
 
 	/**
 	 * Answers whether the character is a whitespace character in Java.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java?view=diff&rev=442428&r1=442427&r2=442428
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java
Mon Sep 11 19:57:50 2006
@@ -774,11 +774,24 @@
     public void test_isDefinedC() {
         // Test for method boolean java.lang.Character.isDefined(char)
         assertTrue("Defined character returned false", Character.isDefined('v'));
-        assertTrue("Undefined character returned true", Character
+        assertTrue("Defined character returned false", Character
                 .isDefined('\u6039'));
     }
 
     /**
+     * @tests java.lang.Character#isDefined(int)
+     */
+    public void test_isDefined_I(){
+        assertTrue(Character.isDefined((int)'v'));
+        assertTrue(Character.isDefined((int)'\u6039'));
+        assertTrue(Character.isDefined(0x10300));
+        
+        assertFalse(Character.isDefined(0x30000));
+        assertFalse(Character.isDefined(0x3FFFF));
+        assertFalse(Character.isDefined(0x110000));
+    }
+    
+    /**
      * @tests java.lang.Character#isDigit(char)
      */
     public void test_isDigitC() {
@@ -786,6 +799,41 @@
         assertTrue("Digit returned false", Character.isDigit('1'));
         assertTrue("Non-Digit returned false", !Character.isDigit('A'));
     }
+    
+    /**
+     * @tests java.lang.Character#isDigit(int)
+     */
+    public void test_isDigit_I() {
+        assertTrue(Character.isDigit((int) '1'));
+        assertFalse(Character.isDigit((int) 'A'));
+        
+        assertTrue(Character.isDigit(0x0030));
+        assertTrue(Character.isDigit(0x0035));
+        assertTrue(Character.isDigit(0x0039));
+        
+        assertTrue(Character.isDigit(0x0660));
+        assertTrue(Character.isDigit(0x0665));
+        assertTrue(Character.isDigit(0x0669));
+        
+        assertTrue(Character.isDigit(0x06F0));
+        assertTrue(Character.isDigit(0x06F5));
+        assertTrue(Character.isDigit(0x06F9));
+        
+        assertTrue(Character.isDigit(0x0966));
+        assertTrue(Character.isDigit(0x096A));
+        assertTrue(Character.isDigit(0x096F));
+        
+        assertTrue(Character.isDigit(0xFF10));
+        assertTrue(Character.isDigit(0xFF15));
+        assertTrue(Character.isDigit(0xFF19));
+        
+        assertTrue(Character.isDigit(0x1D7CE));
+        assertTrue(Character.isDigit(0x1D7D8));
+        
+        assertFalse(Character.isDigit(0x2F800));
+        assertFalse(Character.isDigit(0x10FFFD));
+        assertFalse(Character.isDigit(0x110000));
+    }
 
     /**
      * @tests java.lang.Character#isIdentifierIgnorable(char)
@@ -920,6 +968,22 @@
         assertTrue("Letter returned false", Character.isLetter('L'));
         assertTrue("Non-Letter returned true", !Character.isLetter('9'));
     }
+    
+    /**
+     * @tests java.lang.Character#isLetter(int)
+     */
+    public void test_isLetter_I() {
+        assertTrue(Character.isLetter((int)'L'));
+        assertFalse(Character.isLetter((int)'9'));
+        
+        assertTrue(Character.isLetter(0x1FA9));
+        assertTrue(Character.isLetter(0x1D400));
+        assertTrue(Character.isLetter(0x1D622));
+        assertTrue(Character.isLetter(0x10000));
+        
+        assertFalse(Character.isLetter(0x1012C));
+        assertFalse(Character.isLetter(0x110000));
+    }
 
     /**
      * @tests java.lang.Character#isLetterOrDigit(char)
@@ -931,6 +995,28 @@
         assertTrue("Control returned true", !Character.isLetterOrDigit('\n'));
         assertTrue("Puncutation returned true", !Character.isLetterOrDigit('?'));
     }
+    
+    /**
+     * @tests java.lang.Character#isLetterOrDigit(int)
+     */
+    public void test_isLetterOrDigit_I() {
+        assertTrue(Character.isLetterOrDigit((int)'9'));
+        assertTrue(Character.isLetterOrDigit((int)'K'));
+        assertFalse(Character.isLetterOrDigit((int)'\n'));
+        assertFalse(Character.isLetterOrDigit((int)'?'));
+        
+        assertTrue(Character.isLetterOrDigit(0x1FA9));
+        assertTrue(Character.isLetterOrDigit(0x1D400));
+        assertTrue(Character.isLetterOrDigit(0x1D622));
+        assertTrue(Character.isLetterOrDigit(0x10000));
+
+        assertTrue(Character.isLetterOrDigit(0x1D7CE));
+        assertTrue(Character.isLetterOrDigit(0x1D7D8));
+
+        assertFalse(Character.isLetterOrDigit(0x10FFFD));     
+        assertFalse(Character.isLetterOrDigit(0x1012C));
+        assertFalse(Character.isLetterOrDigit(0x110000));
+    }
 
     /**
      * @tests java.lang.Character#isLowerCase(char)
@@ -940,6 +1026,21 @@
         assertTrue("lower returned false", Character.isLowerCase('a'));
         assertTrue("upper returned true", !Character.isLowerCase('T'));
     }
+    
+    /**
+     * @tests java.lang.Character#isLowerCase(int)
+     */
+    public void test_isLowerCase_I() {
+        assertTrue(Character.isLowerCase((int)'a'));
+        assertFalse(Character.isLowerCase((int)'T'));
+        
+        assertTrue(Character.isLowerCase(0x10428));
+        assertTrue(Character.isLowerCase(0x1D4EA));
+        
+        assertFalse(Character.isLowerCase(0x1D504));
+        assertFalse(Character.isLowerCase(0x30000));
+        assertFalse(Character.isLowerCase(0x110000));
+    }
 
     /**
      * @tests java.lang.Character#isSpace(char)
@@ -1021,6 +1122,21 @@
         // Test for method boolean java.lang.Character.isUpperCase(char)
         assertTrue("Incorrect case value", !Character.isUpperCase('t'));
         assertTrue("Incorrect case value", Character.isUpperCase('T'));
+    }
+    
+    /**
+     * @tests java.lang.Character#isUpperCase(int)
+     */
+    public void test_isUpperCase_I() {
+        assertFalse(Character.isUpperCase((int)'t'));
+        assertTrue(Character.isUpperCase((int)'T'));
+        
+        assertTrue(Character.isUpperCase(0x1D504));
+        assertTrue(Character.isUpperCase(0x1D608));
+        
+        assertFalse(Character.isUpperCase(0x1D656));
+        assertFalse(Character.isUpperCase(0x10FFFD));
+        assertFalse(Character.isUpperCase(0x110000));
     }
 
     /**



Mime
View raw message