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

(str) Add notes to String.trim and String.isEmpty pointing to newer APIs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 11
    • core-libs
    • In Review

      The trim() method uses an unusual and dated definition of spaces to trim, whereas the strip() family of methods on String uses the modern, Unicode-based definition of whitespace.

      There should be a note in the trim() method specification that refers people to the strip() family of methods. The lack of such a note may lead to bugs such as JDK-8328175 which requests methods that already exist.

      The isEmpty() method could also use a note that mentions isBlank().

            smarks Stuart Marks
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: