Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 8842 invoked by uid 98); 16 Jan 2003 22:24:59 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 8483 invoked from network); 16 Jan 2003 22:24:46 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 16 Jan 2003 22:24:46 -0000 Received: (qmail 25456 invoked by uid 500); 16 Jan 2003 22:23:00 -0000 Received: (qmail 25380 invoked from network); 16 Jan 2003 22:22:59 -0000 Received: from smtp.netcologne.de (194.8.194.112) by daedalus.apache.org with SMTP; 16 Jan 2003 22:22:59 -0000 Received: from netcologne.de (dial-194-8-195-70.netcologne.de [194.8.195.70]) by smtp.netcologne.de (Postfix) with ESMTP id E3CC2868FE for ; Thu, 16 Jan 2003 23:22:59 +0100 (MET) Message-ID: <3E273067.6090306@netcologne.de> Date: Thu, 16 Jan 2003 23:21:27 +0100 From: Christian Sell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204 X-Accept-Language: de-de, de, en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: [jelly] code question References: <027001c2bd7c$29039450$9865fea9@spiritsoft.com> In-Reply-To: <027001c2bd7c$29039450$9865fea9@spiritsoft.com> X-Enigmail-Version: 0.71.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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