I need to clear the warning or say error message,which will be the best one to choose setMessage(null) or by using StringUtils.EMPTY - i just want to know the exact way of using StringUtils.EMPTY,it would be helpful...
Thanks & Regards.
I need to clear the warning or say error message,which will be the best one to choose setMessage(null) or by using StringUtils.EMPTY - i just want to know the exact way of using StringUtils.EMPTY,it would be helpful...
Thanks & Regards.
Do not use null
.
Since it's a message you might showing it some where,If you set it to null
,it displays as "null"
to end user.
Try like ,
private static final String EMPTY_STRING = "";
setMessage(EMPTY_STRING );
on there other hand you can check with isEmpty
method,instead of checking null
.