Skip to main content

My first open source contribution

Few days ago popular Apache Commons Lang library gained new utility method in Validate class: notBlank(). This also happens to be my first contribution to the open source community (see: LANG-533 and commit 828310). Use notBlank when you want to check whether the given string is not null, not empty, and does contain anything apart from whitespaces:

Validate.notBlank("a");
Validate.notBlank(" a ");
Validate.notBlank(null); //will throw IllegalArgumentException
Validate.notBlank(""); //will throw IllegalArgumentException
Validate.notBlank(" ", "Should not be blank"); //will throw IllegalArgumentException
Validate.notBlank(" \n "); //will throw IllegalArgumentException


This handy method can be used to validate user input or configuration, where single space or newline characters should also be treated as invalid. It will be available in version 3.0 of Lang library.

I know this contribution is so tiny and not very significant, probably not even worth to mention, but I am still proud of it ;-).

Meanwhile I past the middle of "Open-Source ESBs in Action", which is a great book comparing Mule and ServiceMix. Sadly, after first two examples I found Mule to be much more intuitive and easy to use, so I skip ServiceMix chapters. Maybe I will go back to them one day, but for now expect few Mule ESB related articles in the future, as this is the topic I would like to focus now.

Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Congrats! It's not your last contribution, is it? Keep'em coming.

    ReplyDelete
  3. Laozi once said that even "The longest journey begins with a single step". This was my first step and I truly hope the journey just begins :-).

    ReplyDelete

Post a Comment