hg: jdk7/tl/jdk: 6860431: Character.isSurrogate(char ch)

Martin Buchholz martinrb at google.com
Wed Sep 2 03:21:12 UTC 2009


On Tue, Sep 1, 2009 at 01:29, Ulf Zibis <Ulf.Zibis at gmx.de> wrote:

> Martin,
>
> I like how you have enhanced javadoc for Character class.
>
> Some coments:
> - You more like uppercased hex literals, so we are 2. :-)


I like consistency more than I like either uppercase or lowercase.


>
> - you have mixed <code>value</code> and {@code value}. I more like the
> latter, it's compact and better readable


{@code is now the preferred way.  I tried to modify the methods I changed,
but didn't try to change the whole file.
A brave person such as yourself could try to
become "code janitor" for the whole jdk.


- you have mixed U+1234 and \u1234 style. Why?


They are different things.  U+1234 describes a Unicode character or
codepoint,
while '\u1234' is a char (code unit, not code point).
 See Unicode glossary.


> - often you use '\' for '\', but not ever (e.g. '\t'). I think we can
> use always '\'. There should not be so much developers in the world who
> can't decode ISO-8859-1 or UTF-xx.


We try hard to keep source code ASCII.  Sorry, the world is adopting UTF-8,
but the transition is rather slow.  Maybe in 10 years we can go UTF-8
everywhere.


  (aren't there many places in the JDK's javadoc where others have used
> ISO-8859-1 characters ?)
> - there are many "Character#xYz" or even "java.lang.Character#xYz" or "
> "java.lang.Abc#xYz" " links left. They could be truncated for better
> readability and smaller source size


I agree.


>
> - I would like to see backwards-referring like:
>   public static final int MIN_CODE_POINT = MIN_VALUE;
>   public static final int MIN_SUPPLEMENTARY_CODE_POINT = MAX_VALUE + 1;


Those would work, but would add to the confusion
between code points and UTF-16 code units.
Notice how "MAX_VALUE + 1" looks like an oxymoron.

Martin


>
>
> -Ulf
>
>
> Am 01.09.2009 00:11, martinrb at google.com schrieb:
>
>> Changeset: db5d6b4cbc11
>> Author:    martin
>> Date:      2009-08-31 15:00 -0700
>> URL:       http://hg.openjdk.java.net/jdk7/tl/jdk/rev/db5d6b4cbc11
>>
>> 6860431: Character.isSurrogate(char ch)
>> Summary: Add new method Character.isSurrogate(char ch)
>> Reviewed-by: sherman, darcy, okutsu
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20090901/f1d83648/attachment.html>


More information about the core-libs-dev mailing list