Polish: combine catches block with same body
This commit is contained in:
committed by
Juergen Hoeller
parent
f835f7b500
commit
7bce04c06c
@@ -695,11 +695,7 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
|
||||
throw new InvalidPropertyException(getRootClass(), this.nestedPath + propertyName,
|
||||
"Index of out of bounds in property path '" + propertyName + "'", ex);
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
throw new InvalidPropertyException(getRootClass(), this.nestedPath + propertyName,
|
||||
"Invalid index in property path '" + propertyName + "'", ex);
|
||||
}
|
||||
catch (TypeMismatchException ex) {
|
||||
catch (NumberFormatException | TypeMismatchException ex) {
|
||||
throw new InvalidPropertyException(getRootClass(), this.nestedPath + propertyName,
|
||||
"Invalid index in property path '" + propertyName + "'", ex);
|
||||
}
|
||||
|
||||
@@ -504,11 +504,8 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
}
|
||||
return beanInstance;
|
||||
}
|
||||
catch (BeanCreationException ex) {
|
||||
catch (BeanCreationException | ImplicitlyAppearedSingletonException ex) {
|
||||
// A previously detected exception with proper bean creation context already...
|
||||
throw ex;
|
||||
}
|
||||
catch (ImplicitlyAppearedSingletonException ex) {
|
||||
// An IllegalStateException to be communicated up to DefaultSingletonBeanRegistry...
|
||||
throw ex;
|
||||
}
|
||||
|
||||
@@ -85,10 +85,8 @@ public class PathEditor extends PropertyEditorSupport {
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (URISyntaxException ex) {
|
||||
catch (URISyntaxException | FileSystemNotFoundException ex) {
|
||||
// Not a valid URI: Let's try as Spring resource location.
|
||||
}
|
||||
catch (FileSystemNotFoundException ex) {
|
||||
// URI scheme not registered for NIO:
|
||||
// Let's try URL protocol handlers via Spring's resource mechanism.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user