From dee9420cdab18b1fbd79fd64240c202c07a01842 Mon Sep 17 00:00:00 2001 From: dhgarrette Date: Fri, 6 Mar 2009 22:55:38 +0000 Subject: [PATCH] BATCH-1124: Fixed error message that is seen when a class contains two methods with the same listener annotation. --- .../springframework/batch/support/MethodInvokerUtils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java index 4b6a5b25b..65d373888 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java @@ -41,7 +41,8 @@ public class MethodInvokerUtils { * @param object to be invoked * @param methodName of the method to be invoked * @param paramsRequired boolean indicating whether the parameters are - * required, if false, a no args version of the method will be searched for. + * required, if false, a no args version of the method will be + * searched for. * @param paramTypes - parameter types of the method to search for. * @return MethodInvoker if the method is found, null if it is not. */ @@ -105,8 +106,9 @@ public class MethodInvokerUtils { public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { Annotation annotation = AnnotationUtils.findAnnotation(method, annotationType); if (annotation != null) { - Assert.isNull(annotatedMethod.get(), "found more than one method on target class [" + candidate - + "] with the annotation type [" + candidate + "]"); + Assert.isNull(annotatedMethod.get(), "found more than one method on target class [" + + candidate.getClass().getSimpleName() + "] with the annotation type [" + + annotationType.getSimpleName() + "]."); annotatedMethod.set(method); } }