Polish: to get rid unnecessary array creation

This commit is contained in:
igor-suhorukov 2018-02-28 00:12:51 +03:00 committed by Juergen Hoeller
parent bf0308b0cf
commit d1ccecd021
3 changed files with 4 additions and 4 deletions

View File

@ -524,7 +524,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
Closure callable = (Closure) args[args.length - 1]; Closure callable = (Closure) args[args.length - 1];
callable.setDelegate(this); callable.setDelegate(this);
callable.setResolveStrategy(Closure.DELEGATE_FIRST); callable.setResolveStrategy(Closure.DELEGATE_FIRST);
callable.call(new Object[]{currentBeanDefinition}); callable.call(currentBeanDefinition);
} }
GroovyBeanDefinitionWrapper beanDefinition = currentBeanDefinition; GroovyBeanDefinitionWrapper beanDefinition = currentBeanDefinition;

View File

@ -55,8 +55,8 @@ import org.springframework.util.StringUtils;
*/ */
public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> implements JmsHeaderMapper { public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> implements JmsHeaderMapper {
private static final Set<Class<?>> SUPPORTED_PROPERTY_TYPES = new HashSet<>(Arrays.asList(new Class<?>[] { private static final Set<Class<?>> SUPPORTED_PROPERTY_TYPES = new HashSet<>(Arrays.asList(
Boolean.class, Byte.class, Double.class, Float.class, Integer.class, Long.class, Short.class, String.class})); Boolean.class, Byte.class, Double.class, Float.class, Integer.class, Long.class, Short.class, String.class));
@Override @Override

View File

@ -174,7 +174,7 @@ public class ViewResolversBeanDefinitionParser implements BeanDefinitionParser {
beanDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); beanDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
MutablePropertyValues values = beanDef.getPropertyValues(); MutablePropertyValues values = beanDef.getPropertyValues();
List<Element> elements = DomUtils.getChildElementsByTagName(resolverElement, new String[] {"default-views"}); List<Element> elements = DomUtils.getChildElementsByTagName(resolverElement, "default-views");
if (!elements.isEmpty()) { if (!elements.isEmpty()) {
ManagedList<Object> list = new ManagedList<>(); ManagedList<Object> list = new ManagedList<>();
for (Element element : DomUtils.getChildElementsByTagName(elements.get(0), "bean", "ref")) { for (Element element : DomUtils.getChildElementsByTagName(elements.get(0), "bean", "ref")) {