Skip to content

Commit 60ac239

Browse files
committed
BeanDefinitionReader and ClassPath/FileSystemXmlApplicationContext use varargs where possible (SPR-6849)
1 parent c0f4d9c commit 60ac239

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2010 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -136,7 +136,7 @@ public BeanNameGenerator getBeanNameGenerator() {
136136
}
137137

138138

139-
public int loadBeanDefinitions(Resource[] resources) throws BeanDefinitionStoreException {
139+
public int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStoreException {
140140
Assert.notNull(resources, "Resource array must not be null");
141141
int counter = 0;
142142
for (Resource resource : resources) {
@@ -205,7 +205,7 @@ public int loadBeanDefinitions(String location, Set<Resource> actualResources) t
205205
}
206206
}
207207

208-
public int loadBeanDefinitions(String[] locations) throws BeanDefinitionStoreException {
208+
public int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException {
209209
Assert.notNull(locations, "Location array must not be null");
210210
int counter = 0;
211211
for (String location : locations) {

org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2010 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -93,7 +93,7 @@ public interface BeanDefinitionReader {
9393
* @return the number of bean definitions found
9494
* @throws BeanDefinitionStoreException in case of loading or parsing errors
9595
*/
96-
int loadBeanDefinitions(Resource[] resources) throws BeanDefinitionStoreException;
96+
int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStoreException;
9797

9898
/**
9999
* Load bean definitions from the specified resource location.
@@ -116,6 +116,6 @@ public interface BeanDefinitionReader {
116116
* @return the number of bean definitions found
117117
* @throws BeanDefinitionStoreException in case of loading or parsing errors
118118
*/
119-
int loadBeanDefinitions(String[] locations) throws BeanDefinitionStoreException;
119+
int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException;
120120

121121
}

org.springframework.context/src/main/java/org/springframework/context/support/ClassPathXmlApplicationContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2010 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -89,7 +89,7 @@ public ClassPathXmlApplicationContext(String configLocation) throws BeansExcepti
8989
* @param configLocations array of resource locations
9090
* @throws BeansException if context creation failed
9191
*/
92-
public ClassPathXmlApplicationContext(String[] configLocations) throws BeansException {
92+
public ClassPathXmlApplicationContext(String... configLocations) throws BeansException {
9393
this(configLocations, true, null);
9494
}
9595

org.springframework.context/src/main/java/org/springframework/context/support/FileSystemXmlApplicationContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2010 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -90,7 +90,7 @@ public FileSystemXmlApplicationContext(String configLocation) throws BeansExcept
9090
* @param configLocations array of file paths
9191
* @throws BeansException if context creation failed
9292
*/
93-
public FileSystemXmlApplicationContext(String[] configLocations) throws BeansException {
93+
public FileSystemXmlApplicationContext(String... configLocations) throws BeansException {
9494
this(configLocations, true, null);
9595
}
9696

0 commit comments

Comments
 (0)