From: Studying the evolution of exception handling anti-patterns in a long-lived large-scale project
Anti-Pattern | Violations | Affected Handlers or Throwing |
---|---|---|
PMD - Anti-Patterns | ||
Catch Generic | 2440 | 50,51% |
Throws Generic | 495 | 2,60% |
Destructive Wrapping | 215 | 4,45% |
Catch and Do Nothing | 115 | 2,38% |
Throw within Finally | 41 | 0,85% |
Wrong Exception Thrown | 17 | 0,35% |
Relying on getCause() | 5 | 0,10% |
Dummy Handler | 4 | 0,08% |
Error in the Definition of Exception Class | 0 | 0,00% |
PMD - Other Types of Violations | ||
AvoidRethrowingException | 43 | 0,89% |
EmptyFinallyBlock | 18 | 0,37% |
AvoidThrowingNewInstanceOfSameException | 14 | 0,29% |
EmptyTryBlock | 2 | 0,04% |
ExceptionAsFlowControl | 0 | 0,00% |
AvoidCatchingThrowable | 0 | 0,00% |