Progress of patches

Martin Buchholz martinrb at google.com
Thu Mar 11 01:59:31 UTC 2010


On Wed, Mar 10, 2010 at 09:58, Ulf Zibis <Ulf.Zibis at gmx.de> wrote:
> Hi Martin,
>
> there wasn't enough time today, so please wait for tomorrow.
>
> In brief:
> - I wouldn't rename to isBMPCodePoint(), because there are many other names
> in Surrogate class that don't sync to Character and and a usages search in
> sun.nio.cs.* or where ever else could be omitted. Better add "//  return
> Character.isBMPCodePoint(uc);" as hint for the future.
> - Thanks for mention me as contributor.
> - Doesn't the bug description include the addition of isBMPCodePoint() to
> class Character and the equivalent enhancement to isSupplementaryCodePoint()
> ?

Sorry, I should have included the fix to isSupplementaryCodePoint()
in the last fix.

Here's the next fix:

http://cr.openjdk.java.net/~martin/webrevs/openjdk7/isSupplementaryCodePoint/

6666666: A better implementation of Character.isSupplementaryCodePoint
Summary: Clever bit-twiddling saves a few bytes of machine code
Reviewed-by: sherman
Contributed-by: Ulf Zibis <Ulf.Zibis at gmx.de>
diff --git a/src/share/classes/java/lang/Character.java
b/src/share/classes/java/lang/Character.java
--- a/src/share/classes/java/lang/Character.java
+++ b/src/share/classes/java/lang/Character.java
@@ -2693,8 +2693,8 @@
      * @since  1.5
      */
     public static boolean isSupplementaryCodePoint(int codePoint) {
-        return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT
-            && codePoint <= MAX_CODE_POINT;
+        int plane = codePoint >>> 16;
+        return plane != 0 && plane < ((MAX_CODE_POINT + 1) >>> 16);
     }

     /**



More information about the core-libs-dev mailing list