Skip to main content

Table 3 Anti-patterns find in the 2017.2 release

From: Studying the evolution of exception handling anti-patterns in a long-lived large-scale project

Anti-PatternViolationsAffected Handlers or Throwing
PMD - Anti-Patterns
Catch Generic244050,51%
Throws Generic4952,60%
Destructive Wrapping2154,45%
Catch and Do Nothing1152,38%
Throw within Finally410,85%
Wrong Exception Thrown170,35%
Relying on getCause()50,10%
Dummy Handler40,08%
Error in the Definition of Exception Class00,00%
PMD - Other Types of Violations  
AvoidRethrowingException430,89%
EmptyFinallyBlock180,37%
AvoidThrowingNewInstanceOfSameException140,29%
EmptyTryBlock20,04%
ExceptionAsFlowControl00,00%
AvoidCatchingThrowable00,00%