commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <>
Subject RE: [jelly] double checking my logic
Date Mon, 07 Nov 2005 02:37:38 GMT
Not exactly.  The only class that evaluates to true for
isAssignableFrom(Object.class) is Object itself.  That if statement could
probably be rewritten a bit more clearly as:

if(type != null && 
   type.isAssignableFrom(Expression.class) && 
   type != Object.class)

Basically, it's checking to see if "type" is the same as or a
superclass/superinterface (other than Object) of Expression.  So, type ==
Expression.class would cause the expression to evaluate to true and the body
of the if statement to execute.

-----Original Message-----
From: Hans Gilde [] 
Sent: Sunday, November 06, 2005 8:57 PM
To: 'Jakarta Commons Developers List'
Subject: [jelly] double checking my logic

Just to be sure I'm not missing something. the following if condition
couldn't possible execute:


if (type != null && type.isAssignableFrom(Expression.class) &&


The reason being that anything that isAssignableFrom(Expression.class) also





To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message