Re: JULI: java.util.logging
Some side notes unrelated to your primary question but still worth mentioning:
gwoodhouse@gmail.com wrote:
public class ExampleClass
{
private static Logger LOG =
The variable name 'LOG' here does not follow the Java naming conventions,
which call for an initial lower-case letter and mixed-case, with the first
letter of compound word parts (or initials) to be upper case, or for this
variable, 'log'.
Logger.getLogger(ExampleClass.class.getName());
public Boolean evaluate(String a, String b)
{
try
{
if(a.equalsIgnoreCase(b)) { return true; }
else { return false; }
That is so rococo! Why not just 'return a.equalsIgnoreCase( b) );'?
The simpler form is preferred.
Also, you forgot to prevent 'NullPointerException'.
Why are you returning 'Boolean'? Autoboxing is not the greatest thing. If
you must use it, comment the usage along with its purpose. Don't just leave
stuff like that lying around undocumented.
public boolean evaluate( String a, String b )
{
return (a == null? b == null : a.equalsIgnoreCase( b ));
}
Why are you checking for exceptions at all, much less 'Exception'?
Checking for 'Exception' is an antipattern, with a few specialized use cases
where you might use it anyway, none of which apply here.
LOG.info ("An exception was thrown");
}
return false;
}
}
....
My question is, from the above java code example, where would the
"Java" (the name of the programming language) is spelled with an upper-case "J".
--
Lew
Ceci n'est pas une pipe.