On 24 November 2010 14:01, Alasdair Nottingham <[email protected]> wrote:

> 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.
>

why not use  "if (clazz.isInterface() == false)"  ?

it's even more visible and shouldn't confuse people ;)

Alasdair
>
> On 24 Nov 2010, at 13:18, David Bosschaert <[email protected]>
> 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
>

-- 
Cheers, Stuart

Reply via email to