Empty try blocks are either dead code or indicate the presence of debug code.
An empty try block serves no functional purpose. In fact, when compiled to byte code, the empty try block is optimized out and never makes it into the finished program. An empty try block might be indicative of code that has been removed or commented out.
Example 1: The following code contains an empty try block.
try {
//rs = stmt.executeQuery(query);
}
catch(SQLException e) {
log(e);
}
[1] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3050 CAT II
[2] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 561
[3] Sun Microsystems, Inc. Java Sun Tutorial