tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How do I ........?
Date Wed, 15 Nov 2006 20:52:21 GMT
Hash: SHA1


Caldarale, Charles R wrote:
>> From: Steve R Burrus [] 
>> just a tiny correction for you Chris, and that is that the 
>> code ought to 
>> be "if(in = = null)" not as u had it "if(null = = in)". Am I 
>> right or not?
> No, you're not.  The order of operands makes no difference for an
> equality test.  (And don't put spaces in the middle of operators -
> that's not what Chris wrote.)

My use of the 'null' argument first in equality checking comes from my
use of the C programming language. In C, this is a valid statement and
generally does not do what you want:

if(in = null)

In Java, this is a syntax error. (Note the single = sign, indicating
assignment, instead of a double == indicating comparison).

Since you get bitten in C by missing an equals (it's quite easily to
miss it visually), I got into the habit of putting the null first.

As Chuck points out, it's exactly the same thing. Oh, and you can't put
spaces between the equals signs, or the compiler won't recognize it as
the equality operator. The equality operator is "==". It is /not/ two
equals signs, contrary to popular belief. Spaces are simply not allowed.

Why the heck are we discussing things like this on a mailing list for an
app server!?

- -chris

Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message