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

Avoid String.compareTo == 0 to check String equality in java.management

    XMLWordPrintable

    Details

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

      Description

      In several places, String.compareTo == 0 is used to check String.equality
      Instead of this, we can use String.equals and switch expression. They are faster and code is easier to read.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: