Skip to content

Commit 6893207

Browse files
committed
Polishing
1 parent 85c5a0c commit 6893207

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -37,10 +37,16 @@
3737
*
3838
* <p><b>{@code FactoryBean} is a programmatic contract. Implementations are not
3939
* supposed to rely on annotation-driven injection or other reflective facilities.</b>
40-
* {@link #getObjectType()} {@link #getObject()} invocations may arrive early in
41-
* the bootstrap process, even ahead of any post-processor setup. If you need access
40+
* {@link #getObjectType()} {@link #getObject()} invocations may arrive early in the
41+
* bootstrap process, even ahead of any post-processor setup. If you need access to
4242
* other beans, implement {@link BeanFactoryAware} and obtain them programmatically.
4343
*
44+
* <p><b>The container is only responsible for managing the lifecycle of the FactoryBean
45+
* instance, not the lifecycle of the objects created by the FactoryBean.</b> Therefore,
46+
* a destroy method on an exposed bean object (such as {@link java.io.Closeable#close()}
47+
* will <i>not</i> be called automatically. Instead, a FactoryBean should implement
48+
* {@link DisposableBean} and delegate any such close call to the underlying object.
49+
*
4450
* <p>Finally, FactoryBean objects participate in the containing BeanFactory's
4551
* synchronization of bean creation. There is usually no need for internal
4652
* synchronization other than for purposes of lazy initialization within the
@@ -49,6 +55,7 @@
4955
* @author Rod Johnson
5056
* @author Juergen Hoeller
5157
* @since 08.03.2003
58+
* @param <T> the bean type
5259
* @see org.springframework.beans.factory.BeanFactory
5360
* @see org.springframework.aop.framework.ProxyFactoryBean
5461
* @see org.springframework.jndi.JndiObjectFactoryBean

spring-web/src/main/java/org/springframework/web/cors/DefaultCorsProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -172,7 +172,7 @@ protected String checkOrigin(CorsConfiguration config, String requestOrigin) {
172172
/**
173173
* Check the HTTP method and determine the methods for the response of a
174174
* pre-flight request. The default implementation simply delegates to
175-
* {@link org.springframework.web.cors.CorsConfiguration#checkOrigin(String)}.
175+
* {@link org.springframework.web.cors.CorsConfiguration#checkHttpMethod(HttpMethod)}.
176176
*/
177177
protected List<HttpMethod> checkMethods(CorsConfiguration config, HttpMethod requestMethod) {
178178
return config.checkHttpMethod(requestMethod);

0 commit comments

Comments
 (0)