• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Tool to identify problems in catch blocks

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am looking for a tool (may be build time or eclipse plugin) that can help me to identify if I am not logging the Exception trace/message.

We have a legacy application that has try catch block in which a custom error message is logged. The exception is not logged and is not thrown. So, when a problem occurs, there is no stack trace in the log files that would help to debug the issue. An example of this is:



i need a tool like Coverity or Checkstyle that can help me to identify all such occurrences in my code base.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like FindBugs can warn you if an exception is "dropped": see this. There might be other static code analysis tools that would warn you about the same.

It probably won't warn you if it is not properly logged, though. That should not be so much of a problem, you should log exceptions at the topmost level of your program, and probably install an uncaught exception handler to log those that might otherwise be missed. (You might need to setup a Swing-specific uncaught exception handler if you're using Swing.) These places should be few and thus relatively easy to review.

If you're logging and dropping an exception at a lot of places in code, this won't help you. Such a design would look very suspicious to me, though.
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic