Can Findbugs detect catching RuntimeException in java? -


could let me know taht findbugs can detect catcing runtimeexception in java?

effective java recommends should not catch runtimeexception.

so want know findbugs can grab wrong catching.

additionally, checked klocwork jd.catch , checkstyle illegalcatch appropriate purpose.

sort of. in findbugs there several bug detectors dealing exceptions:

  • de: method might drop exception
  • de: method might ignore exception
  • nm: class not derived exception, though named such
  • rv: exception created , dropped rather thrown
  • rec: exception caught when exception not thrown

and findbugs-contrib (findbugs plugin) has some:

  • bed_bogus_exception_declaration
  • dre_declared_runtime_exception
  • exs_exception_softening_no_checked
  • exs_exception_softening_has_checked
  • exs_exception_softening_no_constraints

try out , check if match requirements (especially last 1 (rec) of fb). if plainly need detect following pattern:

catch ( runtimeexception re){     ....             } 

you may need implement own (quite easy) bug pattern findbugs...


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -