Skip to content

Commit e3175a2

Browse files
committed
Polishing
1 parent 91316dc commit e3175a2

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 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.
@@ -39,10 +39,16 @@
3939
*
4040
* <p><b>{@code FactoryBean} is a programmatic contract. Implementations are not
4141
* supposed to rely on annotation-driven injection or other reflective facilities.</b>
42-
* {@link #getObjectType()} {@link #getObject()} invocations may arrive early in
43-
* the bootstrap process, even ahead of any post-processor setup. If you need access
42+
* {@link #getObjectType()} {@link #getObject()} invocations may arrive early in the
43+
* bootstrap process, even ahead of any post-processor setup. If you need access to
4444
* other beans, implement {@link BeanFactoryAware} and obtain them programmatically.
4545
*
46+
* <p><b>The container is only responsible for managing the lifecycle of the FactoryBean
47+
* instance, not the lifecycle of the objects created by the FactoryBean.</b> Therefore,
48+
* a destroy method on an exposed bean object (such as {@link java.io.Closeable#close()}
49+
* will <i>not</i> be called automatically. Instead, a FactoryBean should implement
50+
* {@link DisposableBean} and delegate any such close call to the underlying object.
51+
*
4652
* <p>Finally, FactoryBean objects participate in the containing BeanFactory's
4753
* synchronization of bean creation. There is usually no need for internal
4854
* synchronization other than for purposes of lazy initialization within the

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-2018 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.
@@ -187,7 +187,7 @@ protected String checkOrigin(CorsConfiguration config, @Nullable String requestO
187187
/**
188188
* Check the HTTP method and determine the methods for the response of a
189189
* pre-flight request. The default implementation simply delegates to
190-
* {@link org.springframework.web.cors.CorsConfiguration#checkOrigin(String)}.
190+
* {@link org.springframework.web.cors.CorsConfiguration#checkHttpMethod(HttpMethod)}.
191191
*/
192192
@Nullable
193193
protected List<HttpMethod> checkMethods(CorsConfiguration config, @Nullable HttpMethod requestMethod) {

0 commit comments

Comments
 (0)