commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Sell <christian.s...@netcologne.de>
Subject [jelly] code question
Date Thu, 16 Jan 2003 22:21:27 GMT
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?

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.

regards,
Christian Sell


Mime
View raw message