> Just a kind of curiousity. Have anyone found any bugs in your project
> using code inspection? Mostly local code analysis group is a point of
> interest.

Yup, I've found quite a few in "old code".  A couple of NPE warnings
were valid  (lots of spurious ones weren't), but the most useful is the
"Assignment is not used".  It's more useful than you might imagine.

Some contrived code :

  // BAD
  String foo = null;
  try {
    foo = somethingThatMightThrow();
  } catch (Exception e) {
    log.error("something bad happened", e);
  }
  log.debug("Hey, foo is " + foo); // foo should be non null!

In the above code, the first method might throw, be caught, and continue
without setting foo. If we don't initialise foo to null, the *compiler* will
catch the oversight. If the code handled it correctly (by setting foo in
the exception handler), the inspection would warn us that the
initialisation was unnecessary.

YMMV,
Simon



_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to