String.lastIndexOf confused by unpaired trailing surrogate

Ulf Zibis Ulf.Zibis at gmx.de
Tue Mar 23 18:31:22 UTC 2010


Ok, sorry and thanks.

Wouldn't "deprecated" be more noticeable?

What about using this message from compiler? :
warning: Surrogate is Sun proprietary API and may be removed in a future 
release.
@deprecated Public replacement is {@link Character#isSupplementaryCodePoint}

-Ulf


Am 23.03.2010 19:19, schrieb Martin Buchholz:
> Ulf,
>
> Please do not delete methods in Surrogate.java
> (because we take compatibility seriously)
> but instead gently denigrate them,
> as I do below (added to my patch isBMPCodePoint2)
>
> diff --git a/src/share/classes/sun/nio/cs/Surrogate.java
> b/src/share/classes/sun/nio/cs/Surrogate.java
> --- a/src/share/classes/sun/nio/cs/Surrogate.java
> +++ b/src/share/classes/sun/nio/cs/Surrogate.java
> @@ -77,6 +77,7 @@
>       /**
>        * Tells whether or not the given UCS-4 character must be represented as a
>        * surrogate pair in UTF-16.
> +     * Use of {@link Character#isSupplementaryCodePoint} is generally
> preferred.
>        */
>       public static boolean neededFor(int uc) {
>           return Character.isSupplementaryCodePoint(uc);
> @@ -102,6 +103,7 @@
>
>       /**
>        * Converts the given surrogate pair into a 32-bit UCS-4 character.
> +     * Use of {@link Character#toCodePoint} is generally preferred.
>        */
>       public static int toUCS4(char c, char d) {
>           assert Character.isHighSurrogate(c)&&  Character.isLowSurrogate(d);
>
>
> Martin
>
>
>    




More information about the core-libs-dev mailing list