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

Use String.isEmpty() when applicable in java.base

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b24

      Backports

        Description

        Patterns like string.length() == 0, string.length() != 0, string.length() > 0 and "".equals(string) are common, especially in older code. Replace with isEmpty when applicable (always for string.length() ==/!=/> 0, when string can't be null for "".equals(string)

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  redestad Claes Redestad
                  Reporter:
                  redestad Claes Redestad
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: