redundant array copy in Character.toString(char)

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 1.4.2
    • Affects Version/s: 1.4.0
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: