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 f9b2ef44b..013714e88 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 @@ -15,6 +15,8 @@ */ package org.springframework.batch.core.configuration.xml; +import java.util.List; + import org.springframework.batch.core.listener.StepListenerMetaData; import org.springframework.batch.core.step.item.ForceRollbackForWriteSkipException; import org.springframework.batch.repeat.policy.SimpleCompletionPolicy; @@ -34,8 +36,6 @@ import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; -import java.util.List; - /** * Internal parser for the <chunk/> element inside a step. * @@ -127,11 +127,9 @@ public class ChunkElementParser { } propertyValues.addPropertyValue("skipLimit", skipLimit); } - if (skippableExceptions != null) { - // Even if there is no retryLimit, we can still accept exception - // classes for an abstract parent bean definition - propertyValues.addPropertyValue("skippableExceptionClasses", skippableExceptions); - } + // Even if there is no retryLimit, we can still accept exception + // classes for an abstract parent bean definition + propertyValues.addPropertyValue("skippableExceptionClasses", skippableExceptions); handleItemHandler(bd, "skip-policy", "skipPolicy", null, false, element, parserContext, propertyValues, underspecified); @@ -145,11 +143,9 @@ public class ChunkElementParser { } propertyValues.addPropertyValue("retryLimit", retryLimit); } - if (retryableExceptions != null) { - // Even if there is no retryLimit, we can still accept exception - // classes for an abstract parent bean definition - propertyValues.addPropertyValue("retryableExceptionClasses", retryableExceptions); - } + // Even if there is no retryLimit, we can still accept exception + // classes for an abstract parent bean definition + propertyValues.addPropertyValue("retryableExceptionClasses", retryableExceptions); handleItemHandler(bd, "retry-policy", "retryPolicy", null, false, element, parserContext, propertyValues, underspecified); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java index 33d2edc66..1f777b9b1 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java @@ -15,6 +15,16 @@ */ package org.springframework.batch.core.configuration.xml; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; + import org.junit.Test; import org.springframework.batch.classify.SubclassClassifier; import org.springframework.batch.core.Step; @@ -39,17 +49,6 @@ import org.springframework.dao.PessimisticLockingFailureException; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.util.StringUtils; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; -import java.util.Map; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - /** * @author Dan Garrette * @author Dave Syer @@ -184,22 +183,6 @@ public class ChunkElementParserTests { containsClassified(retryable, CannotSerializeTransactionException.class, false); } - @Test - public void testRetryableInherited() throws Exception { - Map, Boolean> retryable = getRetryableExceptionClasses("s3", getContext()); - System.err.println(retryable); - assertEquals(2, retryable.size()); - containsClassified(retryable, IOException.class, true); - } - - @Test - public void testRetryableInheritedMerge() throws Exception { - Map, Boolean> retryable = getRetryableExceptionClasses("s4", getContext()); - System.err.println(retryable); - assertEquals(3, retryable.size()); - containsClassified(retryable, IOException.class, true); - } - @Test public void testInheritSkippable() throws Exception { Map, Boolean> skippable = getSkippableExceptionClasses("s1", getContext()); diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml index 77fcf0f6a..aef8df686 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml @@ -30,7 +30,7 @@ - + @@ -51,51 +51,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - -