Static Code Analysis With Eclipse
Please turn off all
There's a bug in this class
Here's the bug
Corrected program
Severity vs. Effort
What is Static Code Analysis?
Turning on Static Code Analysis in Eclipse
Error Levels
Problems Eclipse can find
Methods with a constructor name
Methods overridden but not package visible
Non-static access to a static member
Possible accidental boolean assignment
Empty statement
Undocumented Empty Block
finally does not complete normally
Interface method conflicts with protected 'Object' method
Access to a non-accessible member of an enclosing type
Advanced
Assignment has no effect
Local variable declaration hides another field or variable
Field declaration hides another field or variable
Using a char array in string concatenation
Usage of deprecated API
Unused Code
Unused Code Problems
Unused Code Example
Thornier Problems
Hidden catch blocks
JavaDoc
Checking for undocumented code
Spell checking
Java 5 Checks
Unchecked Generic type operation
Generic type parameter declared with a final type bound
Inexact type match for varargs arguments
Boxing and unboxing conversions
Missing @Override annotation
Annotation is used as a superinterface
Not all enum constants covered on switch
Unhandled warning tokens in @SuppressWarnings
Lint Comments
Plug-Ins
PMD
Checkstyle
FindBugs
Java PathFinder
Thanks To
To Learn More
Questions?
Entire Presentation as Single File
Start
|
Cafe con Leche
Copyright 2005 Elliotte Rusty Harold
Last Modified September 7, 2005