Commons Lang
  1. Commons Lang
  2. LANG-533

Validate: support for validating blank strings

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 3.0
    • Component/s: lang.*
    • Labels:
      None

      Description

      Validate class lacks of blank string (not null and not whitespace) validation, based on StringUtils#isBlank. There is only notEmpty method, which does not trim examined string. Example implementation with javadocs attached.

      1. LANG-533.patch
        9 kB
        Tomasz Nurkiewicz

        Activity

        Hide
        Henri Yandell added a comment -

        Thanks Tomasz. Patch applied:

        svn ci -m "Applying Tomasz Nurkiewicz's patch from LANG-533 adding notBlank methods to Validate"
        Sending src/java/org/apache/commons/lang/Validate.java
        Sending src/test/org/apache/commons/lang/ValidateTest.java
        Transmitting file data ..
        Committed revision 828310.

        Show
        Henri Yandell added a comment - Thanks Tomasz. Patch applied: svn ci -m "Applying Tomasz Nurkiewicz's patch from LANG-533 adding notBlank methods to Validate" Sending src/java/org/apache/commons/lang/Validate.java Sending src/test/org/apache/commons/lang/ValidateTest.java Transmitting file data .. Committed revision 828310.
        Hide
        Tomasz Nurkiewicz added a comment -

        I've attached a patch for this issue. It contains notBlank() implementations (method name corrected, thx) and few unit tests. They do not follow convention in ValidateTest class, I use given/when/then pattern and properly named test method names, which explain what the test examines and tests only single feature.

        Show
        Tomasz Nurkiewicz added a comment - I've attached a patch for this issue. It contains notBlank() implementations (method name corrected, thx) and few unit tests. They do not follow convention in ValidateTest class, I use given/when/then pattern and properly named test method names, which explain what the test examines and tests only single feature.
        Hide
        Henri Yandell added a comment -

        Needs tests. Second method is incorrectly called notEmpty (c+p error).

        Show
        Henri Yandell added a comment - Needs tests. Second method is incorrectly called notEmpty (c+p error).

          People

          • Assignee:
            Unassigned
            Reporter:
            Tomasz Nurkiewicz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development