Empty Try Block
ID |
java.empty_try_block |
Severity |
info |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Reliability |
Language |
Java |
Tags |
CWE:1071, reliability |
Rationale
An empty try block is dead code: no statement can throw, so the associated catch and finally clauses will never trigger their exception-handling paths. The construct adds syntactic noise without functional value and usually indicates that the intended logic was never added.
// Bad — empty try
try {
} catch (IOException e) {
log.error("I/O error", e);
}