Special Cases
Warnings
Do not ignore compiler/IDE warnings
Each warning is a potential/existing bug
Do not suppress warnings - Find the correct solution instead
Use the capabilities of your IDE - Turn on most of the possible warnings
Do not add new code with warnings!
Use code checkers - CheckStyle, FindBugs, PMD, Sonar, etc.
Example: Bad: Suppressed warnings
Example: Good: Fixed problems
Logging
Use correct logging levels
Log stack trace only for unexpected program errors
Create (concatenate) expensive message only if logged - see SLF4J capabilities
Java
Never use raw types - always use generics correctly
Avoid using reflection
Know you API - use utility methods
Last updated