Already StringUtils checks is the string is not null so you dont have to check if it is not null, actuall this entrire line can be replaced with just:
 StringUtils.isNotBlank(type)