From 3649f0f3179ca15687f2eedaf5947c76a90bde85 Mon Sep 17 00:00:00 2001 From: dsyer Date: Mon, 4 Jan 2010 13:30:29 +0000 Subject: [PATCH] BATCH-1387: Fix class not found in parser in IDE (Class.forName()). --- .../configuration/xml/ChunkElementParser.java | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java index c50016bb1..dd04e0f2e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java @@ -19,6 +19,7 @@ import java.util.List; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.factory.config.RuntimeBeanReference; +import org.springframework.beans.factory.config.TypedStringValue; import org.springframework.beans.factory.parsing.CompositeComponentDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.GenericBeanDefinition; @@ -295,25 +296,7 @@ public class ChunkElementParser { ManagedMap map, ParserContext parserContext) { for (Element child : (List) DomUtils.getChildElementsByTagName(exceptionClassesElement, elementName)) { String className = child.getAttribute("class"); - try { - Class cls = (Class) Class.forName(className); - if (!Throwable.class.isAssignableFrom(cls)) { - parserContext.getReaderContext().error( - "Non-Throwable class \'" + className + "\' found in <" - + exceptionClassesElement.getNodeName() + "/> element.", exceptionClassesElement); - } - if (map.containsKey(cls)) { - parserContext.getReaderContext().error( - "Duplicate entry for class \'" + className + "\' found in <" - + exceptionClassesElement.getNodeName() + "/> element.", exceptionClassesElement); - } - map.put(cls, include); - } - catch (ClassNotFoundException e) { - parserContext.getReaderContext().error( - "Cannot find class \'" + className + "\', given as an attribute of the <" + elementName - + "/> element.", child); - } + map.put(new TypedStringValue(className, Class.class), include); } }