aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alasdair Nottingham <...@apache.org>
Subject Re: Why !!! in "if(!!!clazz.isInterface())" ?
Date Wed, 24 Nov 2010 14:01:37 GMT
Hi,

It is equivalent to if(!clazz.isInterface()), but in my view is more visible. The compiler
even optimises it to a single negation.

I find it really helps as I often mis a single ! when reading code.

Alasdair

On 24 Nov 2010, at 13:18, David Bosschaert <david.bosschaert@gmail.com> wrote:

> Hi all,
> 
> While looking around in some of the Aries codebase I found the
> following line of code [1]:
> 
>  if(!!!clazz.isInterface()) { //...
> 
> Isn't this equivalent to if(!clazz.isInterface()) ? Or is there some
> special magic happening here that I haven't seen before?
> 
> Just curious...
> 
> Cheers,
> 
> David
> 
> [1] http://svn.apache.org/repos/asf/incubator/aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/AsmProxyManager.java

Mime
View raw message