diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/junit/AbstractJUnitRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/junit/AbstractJUnitRule.java index 253d7db564..a804ae06df 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/junit/AbstractJUnitRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/junit/AbstractJUnitRule.java @@ -39,27 +39,21 @@ public abstract class AbstractJUnitRule extends AbstractJavaRule { try { c = Class.forName(JUNIT3_CLASS_NAME); - } catch (ClassNotFoundException t) { - c = null; - } catch (NoClassDefFoundError t) { + } catch (ClassNotFoundException | NoClassDefFoundError t) { c = null; } JUNIT3_CLASS = c; try { c = Class.forName(JUNIT4_CLASS_NAME); - } catch (ClassNotFoundException t) { - c = null; - } catch (NoClassDefFoundError t) { + } catch (ClassNotFoundException | NoClassDefFoundError t) { c = null; } JUNIT4_CLASS = c; try { c = Class.forName(JUNIT5_CLASS_NAME); - } catch (ClassNotFoundException t) { - c = null; - } catch (NoClassDefFoundError t) { + } catch (ClassNotFoundException | NoClassDefFoundError t) { c = null; } JUNIT5_CLASS = c;