Polish: combine catches block with same body

This commit is contained in:
igor-suhorukov
2018-02-27 09:02:34 +03:00
committed by Juergen Hoeller
parent f835f7b500
commit 7bce04c06c
10 changed files with 11 additions and 52 deletions

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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.
}