Only as "informational" comment:
You can use StringUtils.isEmpty() from apache commons for this purpose! It returns false if the String is empty or null.