Instance of is a bad practice to get into in object oriented code - might as well just go back to C and switch statements.

Cheers,
Ruppert

On Nov 24, 2009, at 8:45 AM, Adam Heath wrote:

Adrian Crum wrote:
Or better yet, overload the method so you don't need all those
conditionals.

If the type of the object in the calling method is Object, then it
won't call the overloaded method.

However, this is better:

if (object instanceof String) {
        return UtilValidate.isEmpty((String) object);
}

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to