James Strachan wrote:
From: "Christian Sell" <[EMAIL PROTECTED]>Hello, in several places in class TagLibrary, I see code like the following: Object value = tags.get(name); if (value instanceof Class) { Class type = (Class) value; if ( type != null ) { return TagScript.newInstance(type); } my question is: doesnt "value instanceof Class" always return false if value is null? Isnt the null check therefore redundant?You're absolutely right. The second if (type != null) is completely redundant and can be safely removed.If that is true, the lines Class type = (Class) tags.get(name); if ( type != null ) { return (Tag) type.newInstance(); } in method createTag() are also redundant.Yes; those look like the old code, before the TagFactory interface came along and it looks like those should have been zapped but have been left by accident. I've applied your suggestions to TagLibrary.java - that was the code you were talking about right? Was there any other place where you saw similar redundancies?
not for now. I'll shout if I encounter more
James ------- http://radio.weblogs.com/0112098/ __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
