Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make IsBlank matcher consistent with String.isBlank #326

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Feb 5, 2021

  1. Adds additional unit test that checks all characters considered 'whit…

    …espace' by java.lang.Character
    
    The Java regex character class \s is not consistent with Character.isWhitespace (presumably to mimic how older, non-unicode aware regular expressons worked?)
    This means that testing for blank strings with \s gives inconsistent results with String.isBlank, which delegates to the Character.isWhitespace implementations.
    This new test case demonstrates that inconsistency.
    Thorn1089 committed Feb 5, 2021
    Configuration menu
    Copy the full SHA
    cd267b3 View commit details
    Browse the repository at this point in the history
  2. Changes IsBlank matcher to use String.isBlank

    The principal of least astonishment suggests that the matcher should be consistent with the similarly named string method.
    The isBlank method does a simple O(N) search through the codepoints of the string and bails out at the first non-whitespace character it finds, so I can't think of any negative performance implications here.
    The implementation continues to pass for all original test cases.
    Thorn1089 committed Feb 5, 2021
    Configuration menu
    Copy the full SHA
    6d5f972 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fbae71b View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2021

  1. Replaces isBlank implementation

    String#isBlank is a newer convenience method and not supported on all target platforms
    Thorn1089 committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    c802ff7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    62e747d View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2021

  1. Configuration menu
    Copy the full SHA
    620bbbc View commit details
    Browse the repository at this point in the history