You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2006/03/22 07:57:59 UTC

[jira] Commented: (HARMONY-217) java.text.BreakIterator.following() incorrectly calculates the following boundary

    [ http://issues.apache.org/jira/browse/HARMONY-217?page=comments#action_12371384 ] 

Paulex Yang commented on HARMONY-217:
-------------------------------------

This is a very similar case with JIRA-62, which are both caused by different rules of RI and ICU4J. I believe ICU4J's objective is try best to follow latest Unicode specs, while sometimes they may be different with RI. I will try to study ICU4J document to see if we can customize the rules to comply with RI's behaviour.

> java.text.BreakIterator.following() incorrectly calculates the following boundary
> ---------------------------------------------------------------------------------
>
>          Key: HARMONY-217
>          URL: http://issues.apache.org/jira/browse/HARMONY-217
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>  Environment: J9 + Hamony
>     Reporter: Anton Avtamonov

>
> Use the following test case (which pass on RI) to understand the issue:
> import java.text.BreakIterator;
> import junit.framework.TestCase;
> public class BreakIteratorTest extends TestCase {
>     private BreakIterator bi;
>     protected void setUp() throws Exception {
>         bi = BreakIterator.getWordInstance();
>     }
>     protected void tearDown() throws Exception {
>         bi = null;
>     }
>     public void testFollowing() throws Exception {
>         bi.setText("000   111");
>         checkWordBounds(2, 0, 3);
>         checkWordBounds(4, 3, 6);
>         checkWordBounds(7, 6, 9);
>     }
>     private void checkWordBounds(final int offset,
>                                  final int expectedBeginOffset,
>                                  final int expectedEndOffset) {
>         assertEquals(expectedBeginOffset, bi.preceding(offset));
>         assertEquals(expectedEndOffset, bi.following(offset));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira