Polishing

This commit is contained in:
Juergen Hoeller
2017-03-24 13:41:34 +01:00
parent c4fda0e811
commit 21ac764e5c
12 changed files with 130 additions and 105 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-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.
@@ -186,7 +186,7 @@ class ConfigurationClassBeanDefinitionReader {
// Consider name and any aliases
AnnotationAttributes bean = AnnotationConfigUtils.attributesFor(metadata, Bean.class);
List<String> names = new ArrayList<String>(Arrays.asList(bean.getStringArray("name")));
String beanName = (names.size() > 0 ? names.remove(0) : methodName);
String beanName = (!names.isEmpty() ? names.remove(0) : methodName);
// Register aliases even when overridden
for (String alias : names) {
@@ -336,7 +336,7 @@ class ConfigurationClassBeanDefinitionReader {
}
readerInstanceCache.put(readerClass, reader);
}
catch (Exception ex) {
catch (Throwable ex) {
throw new IllegalStateException(
"Could not instantiate BeanDefinitionReader class [" + readerClass.getName() + "]");
}