According to a friend, I found a good Java environment error checking tool findBugs.
This tool is really great. I used this tool to find some small bugs in my code. After all, people are human, and they make mistakes. The tool is better than people. Surprisingly, this tool checks bugs that may cause Connection, Statement, ResultSet, and other resource classes to forget to close. This feature is particularly powerful. For example:
Conneciton conn = ...;
Statement stmt = conn. createStatement ();
ResultSet rs = stmt.exe cuteQuery (SQL );
Such code may cause resource leakage in case of exceptions. FindBugs can check bugs that may occur when exceptions occur. It is really strong.
Here is an introduction:
Http://www-900.ibm.com/developerWorks/cn/java/j-findbug1/index.shtml
Http://www-900.ibm.com/developerWorks/cn/java/j-findbug1/index.shtml
Download:
Http://findbugs.sourceforge.net/
Suggestion: Use findBugs to check your code immediately.
Java is an open world with many open resources, such as junit, log4j, ant, hibernate, findBugs, and open for business. Embrace Java and openness !!