Tony Collen <[EMAIL PROTECTED]> > Likewise, I've seen something like this in code... can't > remember if it's anywhere in Cocoon: > > if ( "something".equals(stringToCompare) { > ... > } > > IMO it seems more straightforward and easier to read if it's: > > if ( stringToCompare.equals("something") ) { > ... > } > > Is this just a matter of style as well? The first way seems > goofy if you ask me. > > > Tony >
That's a common Java coding idiom: if "stringToCompare" is null things don't blow up at run time. It seems goofy, but in this case it makes sense...