Harmony
  1. Harmony
  2. HARMONY-1116

[classlib][text] Bidi.getLength() result differs from RI when flag > 61

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      RI returns 0 for java.text.Bidi.getLength() if object was created via Bidi(String paragraph, int flags) with flag>61 like below:

      Bidi bd = new Bidi("Java is the best", 62);

      From the specification for Bidi constructor:
      flags - a collection of flags that control the algorithm. The algorithm
      understands the flags DIRECTION_LEFT_TO_RIGHT, DIRECTION_RIGHT_TO_LEFT,
      DIRECTION_DEFAULT_LEFT_TO_RIGHT, and DIRECTION_DEFAULT_RIGHT_TO_LEFT.
      Other values are reserved.

      ------------------------- Test ----------------------------------

      import java.text.*;

      public class bug9383 {
      public static void main (String[] args) {
      try

      { Bidi bd = new Bidi("Java is the best", 62); System.out.println("len="+bd.getLength()); }

      catch (Exception e)

      { e.printStackTrace(); }

      }
      }

      ---------------------------- Output -------------------------------------------

      RI
      len=0

      Harmony
      len=16

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Denis Kishenko
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development