Skip to content

Commit ad475ff

Browse files
committed
Consistent vararg declarations for String array setters
1 parent 47006ee commit ad475ff

File tree

40 files changed

+244
-290
lines changed

40 files changed

+244
-290
lines changed

spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -240,7 +240,7 @@ public void setArgumentNames(String argNames) {
240240
setArgumentNamesFromStringArray(tokens);
241241
}
242242

243-
public void setArgumentNamesFromStringArray(String[] args) {
243+
public void setArgumentNamesFromStringArray(String... args) {
244244
this.argumentNames = new String[args.length];
245245
for (int i = 0; i < args.length; i++) {
246246
this.argumentNames[i] = StringUtils.trimWhitespace(args[i]);

spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -40,24 +40,24 @@ public void setExpression(String expression) {
4040
this.pointcut.setExpression(expression);
4141
}
4242

43+
public String getExpression() {
44+
return this.pointcut.getExpression();
45+
}
46+
4347
public void setLocation(String location) {
4448
this.pointcut.setLocation(location);
4549
}
4650

51+
public String getLocation() {
52+
return this.pointcut.getLocation();
53+
}
54+
4755
public void setParameterTypes(Class<?>[] types) {
4856
this.pointcut.setParameterTypes(types);
4957
}
5058

51-
public void setParameterNames(String[] names) {
59+
public void setParameterNames(String... names) {
5260
this.pointcut.setParameterNames(names);
5361
}
5462

55-
public String getLocation() {
56-
return this.pointcut.getLocation();
57-
}
58-
59-
public String getExpression() {
60-
return this.pointcut.getExpression();
61-
}
62-
6363
}

spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -154,7 +154,7 @@ public void setProxyInterfaces(Class<?>[] proxyInterfaces) throws ClassNotFoundE
154154
* @see org.aopalliance.aop.Advice
155155
* @see org.springframework.aop.target.SingletonTargetSource
156156
*/
157-
public void setInterceptorNames(String[] interceptorNames) {
157+
public void setInterceptorNames(String... interceptorNames) {
158158
this.interceptorNames = interceptorNames;
159159
}
160160

spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegis
175175
* Ordering is significant: The TargetSource returned from the first matching
176176
* TargetSourceCreator (that is, the first that returns non-null) will be used.
177177
*/
178-
public void setCustomTargetSourceCreators(TargetSourceCreator[] targetSourceCreators) {
178+
public void setCustomTargetSourceCreators(TargetSourceCreator... targetSourceCreators) {
179179
this.customTargetSourceCreators = targetSourceCreators;
180180
}
181181

@@ -186,7 +186,7 @@ public void setCustomTargetSourceCreators(TargetSourceCreator[] targetSourceCrea
186186
* This is perfectly valid, if "specific" interceptors such as matching
187187
* Advisors are all we want.
188188
*/
189-
public void setInterceptorNames(String[] interceptorNames) {
189+
public void setInterceptorNames(String... interceptorNames) {
190190
this.interceptorNames = interceptorNames;
191191
}
192192

spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -60,7 +60,7 @@ public class BeanNameAutoProxyCreator extends AbstractAutoProxyCreator {
6060
* @see org.springframework.beans.factory.FactoryBean
6161
* @see org.springframework.beans.factory.BeanFactory#FACTORY_BEAN_PREFIX
6262
*/
63-
public void setBeanNames(String[] beanNames) {
63+
public void setBeanNames(String... beanNames) {
6464
Assert.notEmpty(beanNames, "'beanNames' must not be empty");
6565
this.beanNames = new ArrayList<String>(beanNames.length);
6666
for (String mappedName : beanNames) {

spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -47,15 +47,15 @@ public class NameMatchMethodPointcut extends StaticMethodMatcherPointcut impleme
4747
* @see #setMappedNames
4848
*/
4949
public void setMappedName(String mappedName) {
50-
setMappedNames(new String[] {mappedName});
50+
setMappedNames(mappedName);
5151
}
5252

5353
/**
5454
* Set the method names defining methods to match.
5555
* Matching will be the union of all these; if any match,
5656
* the pointcut matches.
5757
*/
58-
public void setMappedNames(String[] mappedNames) {
58+
public void setMappedNames(String... mappedNames) {
5959
this.mappedNames = new LinkedList<String>();
6060
if (mappedNames != null) {
6161
this.mappedNames.addAll(Arrays.asList(mappedNames));

spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcutAdvisor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -68,7 +68,7 @@ public void setMappedName(String mappedName) {
6868
* the pointcut matches.
6969
* @see NameMatchMethodPointcut#setMappedNames
7070
*/
71-
public void setMappedNames(String[] mappedNames) {
71+
public void setMappedNames(String... mappedNames) {
7272
this.pointcut.setMappedNames(mappedNames);
7373
}
7474

spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -98,7 +98,7 @@ public RegexpMethodPointcutAdvisor(String[] patterns, Advice advice) {
9898
* @see #setPatterns
9999
*/
100100
public void setPattern(String pattern) {
101-
setPatterns(new String[] {pattern});
101+
setPatterns(pattern);
102102
}
103103

104104
/**
@@ -108,7 +108,7 @@ public void setPattern(String pattern) {
108108
* patterns matches, the pointcut matches.
109109
* @see AbstractRegexpMethodPointcut#setPatterns
110110
*/
111-
public void setPatterns(String[] patterns) {
111+
public void setPatterns(String... patterns) {
112112
this.patterns = patterns;
113113
}
114114

spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -166,7 +166,7 @@ public interface BeanDefinition extends AttributeAccessor, BeanMetadataElement {
166166
* Set the names of the beans that this bean depends on being initialized.
167167
* The bean factory will guarantee that these beans get initialized first.
168168
*/
169-
void setDependsOn(String[] dependsOn);
169+
void setDependsOn(String... dependsOn);
170170

171171
/**
172172
* Return whether this bean is a candidate for getting autowired into some other bean.

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public int getDependencyCheck() {
556556
* of dependencies like statics (*ugh*) or database preparation on startup.
557557
*/
558558
@Override
559-
public void setDependsOn(String[] dependsOn) {
559+
public void setDependsOn(String... dependsOn) {
560560
this.dependsOn = dependsOn;
561561
}
562562

0 commit comments

Comments
 (0)