Consistent vararg declarations for String array setters
This commit is contained in:
@@ -31,9 +31,9 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public abstract class CacheOperation implements BasicOperation {
|
||||
|
||||
private Set<String> cacheNames = Collections.emptySet();
|
||||
private String name = "";
|
||||
|
||||
private String condition = "";
|
||||
private Set<String> cacheNames = Collections.emptySet();
|
||||
|
||||
private String key = "";
|
||||
|
||||
@@ -43,36 +43,16 @@ public abstract class CacheOperation implements BasicOperation {
|
||||
|
||||
private String cacheResolver = "";
|
||||
|
||||
private String name = "";
|
||||
private String condition = "";
|
||||
|
||||
|
||||
@Override
|
||||
public Set<String> getCacheNames() {
|
||||
return cacheNames;
|
||||
}
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getKeyGenerator() {
|
||||
return keyGenerator;
|
||||
}
|
||||
|
||||
public String getCacheManager() {
|
||||
return cacheManager;
|
||||
}
|
||||
|
||||
public String getCacheResolver() {
|
||||
return cacheResolver;
|
||||
public void setName(String name) {
|
||||
Assert.hasText(name);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setCacheName(String cacheName) {
|
||||
@@ -80,17 +60,17 @@ public abstract class CacheOperation implements BasicOperation {
|
||||
this.cacheNames = Collections.singleton(cacheName);
|
||||
}
|
||||
|
||||
public void setCacheNames(String[] cacheNames) {
|
||||
public void setCacheNames(String... cacheNames) {
|
||||
this.cacheNames = new LinkedHashSet<String>(cacheNames.length);
|
||||
for (String cacheName : cacheNames) {
|
||||
Assert.hasText(cacheName, "Cache name must be set if specified.");
|
||||
Assert.hasText(cacheName, "Cache name must be non-null if specified");
|
||||
this.cacheNames.add(cacheName);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCondition(String condition) {
|
||||
Assert.notNull(condition);
|
||||
this.condition = condition;
|
||||
@Override
|
||||
public Set<String> getCacheNames() {
|
||||
return this.cacheNames;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
@@ -98,26 +78,47 @@ public abstract class CacheOperation implements BasicOperation {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public void setKeyGenerator(String keyGenerator) {
|
||||
Assert.notNull(keyGenerator);
|
||||
this.keyGenerator = keyGenerator;
|
||||
}
|
||||
|
||||
public String getKeyGenerator() {
|
||||
return this.keyGenerator;
|
||||
}
|
||||
|
||||
public void setCacheManager(String cacheManager) {
|
||||
Assert.notNull(cacheManager);
|
||||
this.cacheManager = cacheManager;
|
||||
}
|
||||
|
||||
public String getCacheManager() {
|
||||
return this.cacheManager;
|
||||
}
|
||||
|
||||
public void setCacheResolver(String cacheResolver) {
|
||||
Assert.notNull(cacheManager);
|
||||
this.cacheResolver = cacheResolver;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
Assert.hasText(name);
|
||||
this.name = name;
|
||||
public String getCacheResolver() {
|
||||
return this.cacheResolver;
|
||||
}
|
||||
|
||||
public void setCondition(String condition) {
|
||||
Assert.notNull(condition);
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
public String getCondition() {
|
||||
return this.condition;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This implementation compares the {@code toString()} results.
|
||||
* @see #toString()
|
||||
@@ -152,23 +153,15 @@ public abstract class CacheOperation implements BasicOperation {
|
||||
* <p>Available to subclasses, for inclusion in their {@code toString()} result.
|
||||
*/
|
||||
protected StringBuilder getOperationDescription() {
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append(getClass().getSimpleName());
|
||||
result.append("[");
|
||||
result.append(this.name);
|
||||
result.append("] caches=");
|
||||
result.append(this.cacheNames);
|
||||
result.append(" | key='");
|
||||
result.append(this.key);
|
||||
result.append("' | keyGenerator='");
|
||||
result.append(this.keyGenerator);
|
||||
result.append("' | cacheManager='");
|
||||
result.append(this.cacheManager);
|
||||
result.append("' | cacheResolver='");
|
||||
result.append(this.cacheResolver);
|
||||
result.append("' | condition='");
|
||||
result.append(this.condition);
|
||||
result.append("'");
|
||||
StringBuilder result = new StringBuilder(getClass().getSimpleName());
|
||||
result.append("[").append(this.name);
|
||||
result.append("] caches=").append(this.cacheNames);
|
||||
result.append(" | key='").append(this.key);
|
||||
result.append("' | keyGenerator='").append(this.keyGenerator);
|
||||
result.append("' | cacheManager='").append(this.cacheManager);
|
||||
result.append("' | cacheResolver='").append(this.cacheResolver);
|
||||
result.append("' | condition='").append(this.condition).append("'");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateCo
|
||||
* Set the name-matching patterns for determining autowire candidates.
|
||||
* @param autowireCandidatePatterns the patterns to match against
|
||||
*/
|
||||
public void setAutowireCandidatePatterns(String[] autowireCandidatePatterns) {
|
||||
public void setAutowireCandidatePatterns(String... autowireCandidatePatterns) {
|
||||
this.autowireCandidatePatterns = autowireCandidatePatterns;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateCo
|
||||
AnnotationConfigUtils.registerAnnotationConfigProcessors(this.registry);
|
||||
}
|
||||
|
||||
return this.registry.getBeanDefinitionCount() - beanCountAtScanStart;
|
||||
return (this.registry.getBeanDefinitionCount() - beanCountAtScanStart);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -72,7 +72,7 @@ public abstract class AbstractRefreshableConfigApplicationContext extends Abstra
|
||||
* Set the config locations for this application context.
|
||||
* <p>If not set, the implementation may use a default as appropriate.
|
||||
*/
|
||||
public void setConfigLocations(String[] locations) {
|
||||
public void setConfigLocations(String... locations) {
|
||||
if (locations != null) {
|
||||
Assert.noNullElements(locations, "Config locations must not be null");
|
||||
this.configLocations = new String[locations.length];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -68,7 +68,7 @@ public class MethodExclusionMBeanInfoAssembler extends AbstractConfigurableMBean
|
||||
* that bean is found in the {@code ignoredMethodsMappings} property.
|
||||
* @see #setIgnoredMethodMappings(java.util.Properties)
|
||||
*/
|
||||
public void setIgnoredMethods(String[] ignoredMethodNames) {
|
||||
public void setIgnoredMethods(String... ignoredMethodNames) {
|
||||
this.ignoredMethods = new HashSet<String>(Arrays.asList(ignoredMethodNames));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -44,7 +44,7 @@ public class ManagedNotification {
|
||||
/**
|
||||
* Set a list of notification types.
|
||||
*/
|
||||
public void setNotificationTypes(String[] notificationTypes) {
|
||||
public void setNotificationTypes(String... notificationTypes) {
|
||||
this.notificationTypes = notificationTypes;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -21,7 +21,6 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.naming.NameNotFoundException;
|
||||
import javax.naming.NamingException;
|
||||
|
||||
@@ -74,16 +73,6 @@ public class SimpleJndiBeanFactory extends JndiLocatorSupport implements BeanFac
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a list of names of shareable JNDI resources,
|
||||
* which this factory is allowed to cache once obtained.
|
||||
* @param shareableResources the JNDI names
|
||||
* (typically within the "java:comp/env/" namespace)
|
||||
*/
|
||||
public void setShareableResources(String[] shareableResources) {
|
||||
this.shareableResources.addAll(Arrays.asList(shareableResources));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the name of a shareable JNDI resource,
|
||||
* which this factory is allowed to cache once obtained.
|
||||
@@ -94,6 +83,16 @@ public class SimpleJndiBeanFactory extends JndiLocatorSupport implements BeanFac
|
||||
this.shareableResources.add(shareableResource);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a list of names of shareable JNDI resources,
|
||||
* which this factory is allowed to cache once obtained.
|
||||
* @param shareableResources the JNDI names
|
||||
* (typically within the "java:comp/env/" namespace)
|
||||
*/
|
||||
public void setShareableResources(String... shareableResources) {
|
||||
this.shareableResources.addAll(Arrays.asList(shareableResources));
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Implementation of BeanFactory interface
|
||||
|
||||
Reference in New Issue
Block a user