Replace identical catch sections with multi-catch blocks
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -140,10 +140,7 @@ public class RepositoryItemWriter<T> implements ItemWriter<T>, InitializingBean
|
||||
try {
|
||||
invoker.prepare();
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
throw new DynamicMethodInvocationException(e);
|
||||
}
|
||||
catch (NoSuchMethodException e) {
|
||||
catch (ClassNotFoundException | NoSuchMethodException e) {
|
||||
throw new DynamicMethodInvocationException(e);
|
||||
}
|
||||
|
||||
|
||||
@@ -505,15 +505,12 @@ public class StaxEventItemWriter<T> extends AbstractItemStreamItemWriter<T>
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (XMLStreamException xse) {
|
||||
throw new ItemStreamException("Unable to write to file resource: [" + resource + "]", xse);
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
throw new ItemStreamException(
|
||||
"Unable to write to file resource: [" + resource + "] with encoding=[" + encoding + "]", e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new ItemStreamException("Unable to write to file resource: [" + resource + "]", e);
|
||||
catch (XMLStreamException | IOException xse) {
|
||||
throw new ItemStreamException("Unable to write to file resource: [" + resource + "]", xse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user