Browse Source

Polishing

pull/1146/head
Juergen Hoeller 10 years ago
parent
commit
184285ab27
  1. 9
      spring-beans/src/main/java/org/springframework/beans/factory/config/NamedBeanHolder.java
  2. 2
      spring-web/src/main/java/org/springframework/web/cors/CorsConfiguration.java

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

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
package org.springframework.beans.factory.config;
import org.springframework.beans.factory.NamedBean;
import org.springframework.util.Assert;
/**
* A simple holder for a given bean name plus bean instance.
@ -34,20 +35,26 @@ public class NamedBeanHolder<T> implements NamedBean { @@ -34,20 +35,26 @@ public class NamedBeanHolder<T> implements NamedBean {
/**
* Create a new holder for the given bean name plus instance.
* @param beanName the name of the bean
* @param beanInstance the corresponding bean instance
*/
public NamedBeanHolder(String beanName, T beanInstance) {
Assert.notNull(beanName, "Bean name must not be null");
this.beanName = beanName;
this.beanInstance = beanInstance;
}
/**
* Return the name of the bean (never {@code null}).
*/
@Override
public String getBeanName() {
return this.beanName;
}
/**
* Return the corresponding bean instance.
* Return the corresponding bean instance (can be {@code null}).
*/
public T getBeanInstance() {
return this.beanInstance;

2
spring-web/src/main/java/org/springframework/web/cors/CorsConfiguration.java

@ -286,7 +286,7 @@ public class CorsConfiguration { @@ -286,7 +286,7 @@ public class CorsConfiguration {
throw new IllegalArgumentException("'*' is not a valid exposed header value");
}
if (this.exposedHeaders == null) {
this.exposedHeaders = new ArrayList<String>();
this.exposedHeaders = new ArrayList<String>(4);
}
this.exposedHeaders.add(exposedHeader);
}

Loading…
Cancel
Save