Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6583

[classlib][luni]String.lastIndexOf behaves wrongly if the string contains any Supplementary Characters

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0M15
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      windows and linux
    • Patch Info:
      Patch Available

      Description

      If the String contains Supplementary characters in it then String.lastIndexof function returns wrong values in Harmony.

      If the String chars codepoint value above 0xFFFF , then String.lastIndexOf return wrong results.

      Consider the example below:
      if("a\ud800\udc00".lastIndexOf(0x10000) != 1)
      System.out.println("we should not be here");

      Above test passes in RI and fails with harmony.

        Attachments

          Activity

            People

            • Assignee:
              regis_xu Regis Xu
              Reporter:
              mohlogan Mohanraj Loganathan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: