On Wed, Mar 10, 2010 at 09:58, Ulf Zibis <[email protected]> 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 <[email protected]> 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); } /**
