harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6650) Character.getType(int) inconsistent with Character.getType(char): uses different version of unicode
Date Wed, 22 Sep 2010 02:46:33 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913362#action_12913362
] 

Robert Muir commented on HARMONY-6650:
--------------------------------------

I am worried the issue is more widespread in Character.
For example, isLetter has inconsistencies too, which can be seen with a simple test like this:

for (int ch = 0; ch <= Character.MAX_VALUE; ch++)
            assertEquals("inconsistency with isLetter(int)",
                    Character.isLetter(ch),
                    Character.isLetter((char)ch));

For most of these methods, the int-based version just calls UCharacter.
Is there a reason not to do this for the char-based methods too?

Otherwise, I think the various tables in the code need to be regenerated to be consistent.

> Character.getType(int) inconsistent with Character.getType(char): uses different version
of unicode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6650
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6650
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Robert Muir
>
> While looking at Character, i noticed the code looked very different for 'int' than 'char'
here.
> in particular the int method defers to ICU, but the char method binsearches its own table.
> and the comment for that table is:
> // Unicode 3.0.1 (same as Unicode 3.0.0)
> private static final char[] typeValues ....
> But Unicode 3 is the wrong version for java5/6
> So, i tried a character whose type changed from 3.0 to 4.0, just to see.
> For example, compare these two results:
> Character.getType('\u17B5') = 8 (combining mark)
> Character.getType((int) '\u17B5') = 16 (format)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message