Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-8814

Inefficient comparison with the empty string. Use isEmpty() instead

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Prior to JDK 6, we can check if a string is empty by doing "".equals(s) or s.equals("").

      Starting from JDK 6, String class has a new convenience and efficient method isEmpty() to check string's length.

      Attachments

        1. HADOOP-8814.branch-2.patch
          24 kB
          Brandon Li
        2. HADOOP-8814.patch
          25 kB
          Brandon Li
        3. HADOOP-8814.patch
          25 kB
          Brandon Li

        Activity

          People

            brandonli Brandon Li
            brandonli Brandon Li
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: