Empty Static Initializer
ID |
java.empty_static_initializer |
Severity |
info |
Remediation Complexity |
medium |
Remediation Risk |
low |
Remediation Effort |
medium |
Resource |
Code Smell |
Language |
Java |
Tags |
CWE:1071, code-style |
Rationale
An empty static initializer block is dead code. It performs no initialization and adds syntactic noise to the class definition. It usually indicates that a developer started writing static setup code and either forgot to complete it or moved the logic elsewhere without cleaning up.
// Bad -- empty static initializer
public class Config {
static {
}
}