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

Use String.contains() instead of String.indexOf() in java.base

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P5
    • Resolution: Fixed
    • None
    • 18
    • core-libs
    • None
    • b25

    Description

      String.contains was introduced in Java 5.
      Some code in java.base still uses old approach with String.indexOf to check if String contains specified substring.
      I propose to migrate such usages. Makes code shorter and easier to read.

      Attachments

        Issue Links

          Activity

            People

              aturbanov Andrey Turbanov
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: