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

redundant array copy in Character.toString(char)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.2
    • 1.4.0
    • core-libs
    • None
    • mantis
    • generic
    • solaris_8

      Character.toString(char c) creates a new array and then calls a string
      constructor that copies that array into a new array. It would be better
      implemented as a direct call to String.valueOf(char) which avoids the
      extra copy and extra allocation.

      In addition, it would be nice if Character.toString(char) and/or
      String.valueOf(char) were to memoize commonly requested single-character
      strings.

            peytoia Yuka Kamiya (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: