From 23c05b409b6feb1ad41be6e158492f2d26af8247 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 10 Oct 2003 13:50:35 +0000 Subject: [PATCH] Don't mask arbitrary exceptions when looking for a suite method. PR: 23033 Submitted by: Steven Segers git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275444 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/taskdefs/optional/junit/JUnitTestRunner.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java index 985dcbecb..c67b6e152 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java @@ -247,11 +247,9 @@ public class JUnitTestRunner implements TestListener { try { // check if there is a suite method suiteMethod = testClass.getMethod("suite", new Class[0]); - } catch (Exception e) { + } catch (NoSuchMethodException e) { // no appropriate suite method found. We don't report any - // error here since it might be perfectly normal. We don't - // know exactly what is the cause, but we're doing exactly - // the same as JUnit TestRunner do. We swallow the exceptions. + // error here since it might be perfectly normal. } if (suiteMethod != null) { // if there is a suite method available, then try