Browse Source

Merge pull request #18490 from izeye

* pr/18490:
  Polish

Closes gh-18490
pull/18501/head
Phillip Webb 6 years ago
parent
commit
680cdb471f
  1. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
  2. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDataSourceInitializer.java
  3. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java
  4. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfiguration.java
  5. 2
      spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc
  6. 7
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/LazyInitializationBeanFactoryPostProcessor.java
  7. 14
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/LazyInitializationExcludeFilter.java
  8. 2
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PropertyMapper.java

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java

@ -48,7 +48,7 @@ import org.springframework.context.annotation.Import; @@ -48,7 +48,7 @@ import org.springframework.context.annotation.Import;
* <p>
* This configuration class is active only when the RabbitMQ and Spring AMQP client
* libraries are on the classpath.
* <P>
* <p>
* Registers the following beans:
* <ul>
* <li>{@link org.springframework.amqp.rabbit.core.RabbitTemplate RabbitTemplate} if there

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDataSourceInitializer.java

@ -24,7 +24,7 @@ import org.springframework.core.io.ResourceLoader; @@ -24,7 +24,7 @@ import org.springframework.core.io.ResourceLoader;
import org.springframework.util.Assert;
/**
* Initialize the Spring Batch schema (ignoring errors, so should be idempotent).
* Initialize the Spring Batch schema (ignoring errors, so it should be idempotent).
*
* @author Dave Syer
* @author Vedran Pavic

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java

@ -34,7 +34,7 @@ import org.springframework.data.mongodb.gridfs.GridFsTemplate; @@ -34,7 +34,7 @@ import org.springframework.data.mongodb.gridfs.GridFsTemplate;
* <p>
* Registers a {@link MongoTemplate} and {@link GridFsTemplate} beans if no other beans of
* the same type are configured.
* <P>
* <p>
* Honors the {@literal spring.data.mongodb.database} property if set, otherwise connects
* to the {@literal test} database.
*

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfiguration.java

@ -49,7 +49,7 @@ import org.springframework.data.mongodb.gridfs.ReactiveGridFsTemplate; @@ -49,7 +49,7 @@ import org.springframework.data.mongodb.gridfs.ReactiveGridFsTemplate;
* <p>
* Registers a {@link ReactiveMongoTemplate} bean if no other bean of the same type is
* configured.
* <P>
* <p>
* Honors the {@literal spring.data.mongodb.database} property if set, otherwise connects
* to the {@literal test} database.
*

2
spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc

@ -1301,7 +1301,7 @@ By default, Spring Boot picks up the native configuration from its default locat @@ -1301,7 +1301,7 @@ By default, Spring Boot picks up the native configuration from its default locat
=== Configure Logback for Logging
If you need to apply customizations to logback beyond those that can be achieved with `application.properties`, you'll need to add a standard logback configuration file.
You can add a `logback.xml` file to the root of your classpath for logback to find.
You can also use `logback-spring.xml` if you want to use the <<spring-boot-features.adoc#boot-features-logback-extensions,Spring Boot Logback extensions>>)
You can also use `logback-spring.xml` if you want to use the <<spring-boot-features.adoc#boot-features-logback-extensions,Spring Boot Logback extensions>>.
TIP: The Logback documentation has a https://logback.qos.ch/manual/configuration.html[dedicated section that covers configuration] in some detail.

7
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/LazyInitializationBeanFactoryPostProcessor.java

@ -27,7 +27,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; @@ -27,7 +27,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.core.Ordered;
/**
* {@link BeanFactoryPostProcessor} to set lazy-init on bean definitions that not
* {@link BeanFactoryPostProcessor} to set lazy-init on bean definitions that are not
* {@link LazyInitializationExcludeFilter excluded} and have not already had a value
* explicitly set.
*
@ -57,8 +57,11 @@ public final class LazyInitializationBeanFactoryPostProcessor implements BeanFac @@ -57,8 +57,11 @@ public final class LazyInitializationBeanFactoryPostProcessor implements BeanFac
Collection<LazyInitializationExcludeFilter> filters, String beanName,
AbstractBeanDefinition beanDefinition) {
Boolean lazyInit = beanDefinition.getLazyInit();
if (lazyInit != null) {
return;
}
Class<?> beanType = getBeanType(beanFactory, beanName);
if (lazyInit == null && !isExcluded(filters, beanName, beanDefinition, beanType)) {
if (!isExcluded(filters, beanName, beanDefinition, beanType)) {
beanDefinition.setLazyInit(true);
}
}

14
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/LazyInitializationExcludeFilter.java

@ -21,16 +21,16 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; @@ -21,16 +21,16 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
/**
* Filter that can be used to exclude beans definitions from having their
* {@link AbstractBeanDefinition#setLazyInit(boolean) lazy-int} set by the
* {@link AbstractBeanDefinition#setLazyInit(boolean) lazy-init} set by the
* {@link LazyInitializationBeanFactoryPostProcessor}.
* <P>
* <p>
* Primarily intended to allow downstream projects to deal with edge-cases in which it is
* not easy to support lazy-loading (such as in DSLs that dynamically create additional
* beans). Adding an instance of this filter to the application context can be used for
* these edge cases.
* <P>
* <p>
* A typical example would be something like this:
* <P>
* <p>
* <pre><code>
* &#64;Bean
* public static LazyInitializationExcludeFilter integrationLazyInitializationExcludeFilter() {
@ -38,7 +38,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; @@ -38,7 +38,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
* }</code></pre>
* <p>
* NOTE: Beans of this type will be instantiated very early in the spring application
* lifecycle so should generally be declared static and not have any dependencies.
* lifecycle so they should generally be declared static and not have any dependencies.
*
* @author Tyler Van Gorder
* @author Philip Webb
@ -49,11 +49,11 @@ public interface LazyInitializationExcludeFilter { @@ -49,11 +49,11 @@ public interface LazyInitializationExcludeFilter {
/**
* Returns {@code true} if the specified bean definition should be excluded from
* having {@code lazy-int} automatically set.
* having {@code lazy-init} automatically set.
* @param beanName the bean name
* @param beanDefinition the bean definition
* @param beanType the bean type
* @return {@code true} if {@code lazy-int} should not be automatically set
* @return {@code true} if {@code lazy-init} should not be automatically set
*/
boolean isExcluded(String beanName, BeanDefinition beanDefinition, Class<?> beanType);

2
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PropertyMapper.java

@ -22,7 +22,7 @@ import org.springframework.core.env.PropertySource; @@ -22,7 +22,7 @@ import org.springframework.core.env.PropertySource;
/**
* Strategy used to provide a mapping between a {@link PropertySource} and a
* {@link ConfigurationPropertySource}.
* <P>
* <p>
* Mappings should be provided for both {@link ConfigurationPropertyName
* ConfigurationPropertyName} types and {@code String} based names. This allows the
* {@link SpringConfigurationPropertySource} to first attempt any direct mappings (i.e.

Loading…
Cancel
Save