Plexus Utils
  1. Plexus Utils
  2. PLXUTILS-73

Add StringUtils.isBlank() and StringUtils.isNotBlank()

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.5.2
    • Labels:
      None
    • Number of attachments :
      0

      Description

      It's not that beautiful that the natural assertion

        StringUtils.isEmpty(str) iff. !StringUtils.isNotEmpty(str)
      

      does not hold.

      I propose to follow the implementation over at Commons Lang and have isEmpty() not do trimming. Instead, new methods isBlank() and isNotBlank() should be added.

        Issue Links

          Activity

          Hide
          Benjamin Bentmann added a comment -

          Added new methods in r7304.

          Show
          Benjamin Bentmann added a comment - Added new methods in r7304 .
          Hide
          Trygve Laugstøl added a comment -

          beautiful or not, the current behaviour can't change as tons of code might indirectly depend on it.

          Show
          Trygve Laugstøl added a comment - beautiful or not, the current behaviour can't change as tons of code might indirectly depend on it.
          Hide
          Benjamin Bentmann added a comment -

          Just to clarify: I haven't changed the current behavior for isEmpty() yet, I left this open in PLXUTILS-74 and didn't intend to close this in the near future.

          the current behaviour can't change as tons of code might indirectly depend on it.

          Is this to say never ever?

          Show
          Benjamin Bentmann added a comment - Just to clarify: I haven't changed the current behavior for isEmpty() yet, I left this open in PLXUTILS-74 and didn't intend to close this in the near future. the current behaviour can't change as tons of code might indirectly depend on it. Is this to say never ever?
          Hide
          Trygve Laugstøl added a comment -

          Yes, it can't change ever. I would just use commons-lang.

          Show
          Trygve Laugstøl added a comment - Yes, it can't change ever. I would just use commons-lang.
          Hide
          Benjamin Bentmann added a comment -

          I see.

          Show
          Benjamin Bentmann added a comment - I see.

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Benjamin Bentmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: