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

Use single character variant of String.replace when applicable

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:

      Description

      String.replace('a', 'b') is conceivably slightly more efficient than String.replace("a", "b").

      There is a couple of instances of the later variant found in
      src/java.base/share/classes/jdk/internal/module/Resources.java
      and
      src/java.base/share/classes/jdk/internal/module/ModulePath.java

      Reported via core-libs-dev mailing alias.

        Attachments

          Activity

            People

            Assignee:
            igerasim Ivan Gerasimov
            Reporter:
            igerasim Ivan Gerasimov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: