Polishing (backported from master)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -26,7 +26,7 @@ import org.aopalliance.aop.Advice;
|
||||
* <p>Introductions are often <b>mixins</b>, enabling the building of composite
|
||||
* objects that can achieve many of the goals of multiple inheritance in Java.
|
||||
*
|
||||
* <p>Compared to {qlink IntroductionInfo}, this interface allows an advice to
|
||||
* <p>Compared to {@link IntroductionInfo}, this interface allows an advice to
|
||||
* implement a range of interfaces that is not necessarily known in advance.
|
||||
* Thus an {@link IntroductionAdvisor} can be used to specify which interfaces
|
||||
* will be exposed in an advised object.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -36,15 +36,16 @@ import org.springframework.util.StringValueResolver;
|
||||
* Example XML bean definition:
|
||||
*
|
||||
* <pre class="code">
|
||||
* <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
|
||||
* <property name="driverClassName" value="${driver}"/>
|
||||
* <property name="url" value="jdbc:${dbname}"/>
|
||||
* <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
* <property name="driverClassName" value="${driver}" />
|
||||
* <property name="url" value="jdbc:${dbname}" />
|
||||
* </bean>
|
||||
* </pre>
|
||||
*
|
||||
* Example properties file:
|
||||
*
|
||||
* <pre class="code">driver=com.mysql.jdbc.Driver
|
||||
* <pre class="code">
|
||||
* driver=com.mysql.jdbc.Driver
|
||||
* dbname=mysql:mydb</pre>
|
||||
*
|
||||
* Annotated bean definitions may take advantage of property replacement using
|
||||
@@ -56,7 +57,8 @@ import org.springframework.util.StringValueResolver;
|
||||
* in bean references. Furthermore, placeholder values can also cross-reference
|
||||
* other placeholders, like:
|
||||
*
|
||||
* <pre class="code">rootPath=myrootdir
|
||||
* <pre class="code">
|
||||
* rootPath=myrootdir
|
||||
* subPath=${rootPath}/subdir</pre>
|
||||
*
|
||||
* In contrast to {@link PropertyOverrideConfigurer}, subclasses of this type allow
|
||||
@@ -71,13 +73,13 @@ import org.springframework.util.StringValueResolver;
|
||||
*
|
||||
* <p>Default property values can be defined globally for each configurer instance
|
||||
* via the {@link #setProperties properties} property, or on a property-by-property basis
|
||||
* using the default value separator which is {@code ":"} by default and
|
||||
* customizable via {@link #setValueSeparator(String)}.
|
||||
* using the value separator which is {@code ":"} by default and customizable via
|
||||
* {@link #setValueSeparator(String)}.
|
||||
*
|
||||
* <p>Example XML property with default value:
|
||||
*
|
||||
* <pre class="code">
|
||||
* <property name="url" value="jdbc:${dbname:defaultdb}"/>
|
||||
* <property name="url" value="jdbc:${dbname:defaultdb}" />
|
||||
* </pre>
|
||||
*
|
||||
* @author Chris Beams
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -71,12 +71,12 @@ import org.springframework.util.ClassUtils;
|
||||
*
|
||||
* <p>Registered by default when using {@code <context:annotation-config/>} or
|
||||
* {@code <context:component-scan/>}. Otherwise, may be declared manually as
|
||||
* with any other BeanFactoryPostProcessor.
|
||||
* with any other {@link BeanFactoryPostProcessor}.
|
||||
*
|
||||
* <p>This post processor is priority-ordered as it is important that any
|
||||
* {@link Bean} methods declared in {@code @Configuration} classes have
|
||||
* {@link Bean @Bean} methods declared in {@code @Configuration} classes have
|
||||
* their corresponding bean definitions registered before any other
|
||||
* {@link BeanFactoryPostProcessor} executes.
|
||||
* {@code BeanFactoryPostProcessor} executes.
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -48,13 +48,13 @@ public final class CandidateComponentsIndexLoader {
|
||||
public static final String COMPONENTS_RESOURCE_LOCATION = "META-INF/spring.components";
|
||||
|
||||
/**
|
||||
* System property that instructs Spring to ignore the index, i.e.
|
||||
* System property that instructs Spring to ignore the components index, i.e.
|
||||
* to always return {@code null} from {@link #loadIndex(ClassLoader)}.
|
||||
* <p>The default is "false", allowing for regular use of the index. Switching this
|
||||
* flag to {@code true} fulfills a corner case scenario when an index is partially
|
||||
* available for some libraries (or use cases) but couldn't be built for the whole
|
||||
* application. In this case, the application context fallbacks to a regular
|
||||
* classpath arrangement (i.e. as no index was present at all).
|
||||
* classpath arrangement (i.e. as though no index were present at all).
|
||||
*/
|
||||
public static final String IGNORE_INDEX = "spring.index.ignore";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -856,8 +856,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||
beanFactory.getBean(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class));
|
||||
}
|
||||
|
||||
// Register a default embedded value resolver if no bean post-processor
|
||||
// (such as a PropertyPlaceholderConfigurer bean) registered any before:
|
||||
// Register a default embedded value resolver if no BeanFactoryPostProcessor
|
||||
// (such as a PropertySourcesPlaceholderConfigurer bean) registered any before:
|
||||
// at this point, primarily for resolution in annotation attribute values.
|
||||
if (!beanFactory.hasEmbeddedValueResolver()) {
|
||||
beanFactory.addEmbeddedValueResolver(strVal -> getEnvironment().resolvePlaceholders(strVal));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -36,14 +36,17 @@ import java.lang.annotation.Target;
|
||||
*
|
||||
* <p>For ISO-based formatting, set the {@link #iso} attribute to be the desired {@link ISO} format,
|
||||
* such as {@link ISO#DATE}. For custom formatting, set the {@link #pattern} attribute to be the
|
||||
* DateTime pattern, such as {@code yyyy/MM/dd hh:mm:ss a}.
|
||||
* DateTime pattern, such as {@code "yyyy/MM/dd hh:mm:ss a"}.
|
||||
*
|
||||
* <p>Each attribute is mutually exclusive, so only set one attribute per annotation instance
|
||||
* (the one most convenient one for your formatting needs).
|
||||
* When the pattern attribute is specified, it takes precedence over both the style and ISO attribute.
|
||||
* When the {@link #iso} attribute is specified, it takes precedence over the style attribute.
|
||||
* When no annotation attributes are specified, the default format applied is style-based
|
||||
* with a style code of 'SS' (short date, short time).
|
||||
* (the one most convenient for your formatting needs).
|
||||
*
|
||||
* <ul>
|
||||
* <li>When the pattern attribute is specified, it takes precedence over both the style and ISO attribute.</li>
|
||||
* <li>When the {@link #iso} attribute is specified, it takes precedence over the style attribute.</li>
|
||||
* <li>When no annotation attributes are specified, the default format applied is style-based
|
||||
* with a style code of 'SS' (short date, short time).</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -45,10 +45,10 @@ public abstract class TransactionSynchronizationUtils {
|
||||
|
||||
|
||||
/**
|
||||
* Check whether the given resource transaction managers refers to the given
|
||||
* Check whether the given resource transaction manager refers to the given
|
||||
* (underlying) resource factory.
|
||||
* @see ResourceTransactionManager#getResourceFactory()
|
||||
* @see org.springframework.core.InfrastructureProxy#getWrappedObject()
|
||||
* @see InfrastructureProxy#getWrappedObject()
|
||||
*/
|
||||
public static boolean sameResourceFactory(ResourceTransactionManager tm, Object resourceFactory) {
|
||||
return unwrapResourceIfNecessary(tm.getResourceFactory()).equals(unwrapResourceIfNecessary(resourceFactory));
|
||||
@@ -57,7 +57,7 @@ public abstract class TransactionSynchronizationUtils {
|
||||
/**
|
||||
* Unwrap the given resource handle if necessary; otherwise return
|
||||
* the given handle as-is.
|
||||
* @see org.springframework.core.InfrastructureProxy#getWrappedObject()
|
||||
* @see InfrastructureProxy#getWrappedObject()
|
||||
*/
|
||||
static Object unwrapResourceIfNecessary(Object resource) {
|
||||
Assert.notNull(resource, "Resource must not be null");
|
||||
@@ -106,8 +106,8 @@ public abstract class TransactionSynchronizationUtils {
|
||||
try {
|
||||
synchronization.beforeCompletion();
|
||||
}
|
||||
catch (Throwable tsex) {
|
||||
logger.error("TransactionSynchronization.beforeCompletion threw exception", tsex);
|
||||
catch (Throwable ex) {
|
||||
logger.error("TransactionSynchronization.beforeCompletion threw exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,8 +170,8 @@ public abstract class TransactionSynchronizationUtils {
|
||||
try {
|
||||
synchronization.afterCompletion(completionStatus);
|
||||
}
|
||||
catch (Throwable tsex) {
|
||||
logger.error("TransactionSynchronization.afterCompletion threw exception", tsex);
|
||||
catch (Throwable ex) {
|
||||
logger.error("TransactionSynchronization.afterCompletion threw exception", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user