diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java index a47d9d854..82b168390 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 the original author or authors. + * Copyright 2006-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -751,7 +751,7 @@ ResourceAwareItemWriterItemStream, InitializingBean { * * @param items the value object * - * @throws Exception thrown if general error occurs. + * @throws IOException thrown if general error occurs. * @throws XmlMappingException thrown if error occurs during XML Mapping. */ @Override @@ -775,13 +775,9 @@ ResourceAwareItemWriterItemStream, InitializingBean { channel.force(false); } } - catch (XMLStreamException e) { + catch (XMLStreamException | IOException e) { throw new WriteFailedException("Failed to flush the events", e); } - catch (IOException e) { - throw new WriteFailedException("Failed to flush the events", e); - } - } /**