From f96ccfa39e69a2c259fa8043a0b3006f03c70389 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 16 Feb 2010 11:59:29 +0000 Subject: [PATCH] BeanDefinitionReader and ClassPath/FileSystemXmlApplicationContext use varargs where possible (SPR-6849) git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2988 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../beans/factory/support/AbstractBeanDefinitionReader.java | 6 +++--- .../beans/factory/support/BeanDefinitionReader.java | 6 +++--- .../context/support/ClassPathXmlApplicationContext.java | 4 ++-- .../context/support/FileSystemXmlApplicationContext.java | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java index 8d434d18562..b991f208658 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 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. @@ -136,7 +136,7 @@ public abstract class AbstractBeanDefinitionReader implements BeanDefinitionRead } - public int loadBeanDefinitions(Resource[] resources) throws BeanDefinitionStoreException { + public int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStoreException { Assert.notNull(resources, "Resource array must not be null"); int counter = 0; for (Resource resource : resources) { @@ -205,7 +205,7 @@ public abstract class AbstractBeanDefinitionReader implements BeanDefinitionRead } } - public int loadBeanDefinitions(String[] locations) throws BeanDefinitionStoreException { + public int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException { Assert.notNull(locations, "Location array must not be null"); int counter = 0; for (String location : locations) { diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java index 2102eaec2a1..e9ff9c9abe5 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 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. @@ -93,7 +93,7 @@ public interface BeanDefinitionReader { * @return the number of bean definitions found * @throws BeanDefinitionStoreException in case of loading or parsing errors */ - int loadBeanDefinitions(Resource[] resources) throws BeanDefinitionStoreException; + int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStoreException; /** * Load bean definitions from the specified resource location. @@ -116,6 +116,6 @@ public interface BeanDefinitionReader { * @return the number of bean definitions found * @throws BeanDefinitionStoreException in case of loading or parsing errors */ - int loadBeanDefinitions(String[] locations) throws BeanDefinitionStoreException; + int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException; } diff --git a/org.springframework.context/src/main/java/org/springframework/context/support/ClassPathXmlApplicationContext.java b/org.springframework.context/src/main/java/org/springframework/context/support/ClassPathXmlApplicationContext.java index 78ef3a453b2..670461fc549 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/support/ClassPathXmlApplicationContext.java +++ b/org.springframework.context/src/main/java/org/springframework/context/support/ClassPathXmlApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 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. @@ -89,7 +89,7 @@ public class ClassPathXmlApplicationContext extends AbstractXmlApplicationContex * @param configLocations array of resource locations * @throws BeansException if context creation failed */ - public ClassPathXmlApplicationContext(String[] configLocations) throws BeansException { + public ClassPathXmlApplicationContext(String... configLocations) throws BeansException { this(configLocations, true, null); } diff --git a/org.springframework.context/src/main/java/org/springframework/context/support/FileSystemXmlApplicationContext.java b/org.springframework.context/src/main/java/org/springframework/context/support/FileSystemXmlApplicationContext.java index 4faa98321e4..68d506a501b 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/support/FileSystemXmlApplicationContext.java +++ b/org.springframework.context/src/main/java/org/springframework/context/support/FileSystemXmlApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 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. @@ -90,7 +90,7 @@ public class FileSystemXmlApplicationContext extends AbstractXmlApplicationConte * @param configLocations array of file paths * @throws BeansException if context creation failed */ - public FileSystemXmlApplicationContext(String[] configLocations) throws BeansException { + public FileSystemXmlApplicationContext(String... configLocations) throws BeansException { this(configLocations, true, null); }