admin@glassfish.java.net

Re: Code review request

From: Byron Nevins <Byron.Nevins_at_Sun.COM>
Date: Thu, 21 Sep 2006 11:08:10 -0700

My original intention was to point out that the code was much better
than the other way -- which I see all the time -- that can generate a
NPE easily:

if (System.getProperty(JKS_DB_PROPERTY).equals("true"))



Bill Shannon wrote:

> Abhijit Kumar wrote:
>
>> How about using Boolean.getBoolean(JKS_DB_PROPERTY)
>
>
> Much better!
>
> Or even
>
> if (System.getProperty(JKS_DB_PROPERTY,
> "false").equalsIgnoreCase("true"))
>
> Personally, I just *hate* the "if constant equals variable" style,
> even though I understand why people do it. I just find it very
> distracting when reading code.
>
> But we better not turn this into a coding style "discussion" or it
> will never end... :-)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>