Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8165680

[macosx] Enhance handling of UTF-8 characters in CDataTransfer.java

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b147
    • CPU:
      x86
    • OS:
      os_x

      Description

      Suggestion to change the handling of UTF-8 characters in CDataTransfer.java

      charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), "UTF-8”);

      should probably be changed to

         import java.nio.charset.StandardCharsets;
         [...]
         charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), StandardCharsets.UTF_8);

      to avoid the unnecessary charset lookup. Suggestion is made just to improve the codebase.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mhalder Manajit Halder (Inactive)
              Reporter:
              mhalder Manajit Halder (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: