Harmony
  1. Harmony
  2. HARMONY-217

[classlib][text] java.text.BreakIterator.following() incorrectly calculates the following boundary

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      J9 + Hamony

      Description

      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)); }

      }

        Activity

        Hide
        Paulex Yang added a comment -

        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.

        Show
        Paulex Yang added a comment - 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.

          People

          • Assignee:
            Unassigned
            Reporter:
            Anton Avtamonov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development