Around IT in 256 seconds

My first open source contribution

October 25, 2009 | 1 Minute Read

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. Tags: commons, esb, mule

Be the first to listen to new episodes!

To get exclusive content: