Skip to content

Commit ddaf13b

Browse files
committed
Merge branch '6.2.x'
2 parents 22a2332 + 5aa1592 commit ddaf13b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public abstract class AbstractBeanFactoryBasedTargetSource implements TargetSour
6060
protected final transient Log logger = LogFactory.getLog(getClass());
6161

6262
/** Name of the target bean we will create on each invocation. */
63-
private @Nullable String targetBeanName;
63+
protected @Nullable String targetBeanName;
6464

6565
/** Class of the target. */
6666
private volatile @Nullable Class<?> targetClass;

spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
5454
if (!beanFactory.isPrototype(getTargetBeanName())) {
5555
throw new BeanDefinitionStoreException(
5656
"Cannot use prototype-based TargetSource against non-prototype bean with name '" +
57-
getTargetBeanName() + "': instances would not be independent");
57+
this.targetBeanName + "': instances would not be independent");
5858
}
5959
}
6060

@@ -64,7 +64,7 @@ public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
6464
*/
6565
protected Object newPrototypeInstance() throws BeansException {
6666
if (logger.isDebugEnabled()) {
67-
logger.debug("Creating new instance of bean '" + getTargetBeanName() + "'");
67+
logger.debug("Creating new instance of bean '" + this.targetBeanName + "'");
6868
}
6969
return getBeanFactory().getBean(getTargetBeanName());
7070
}
@@ -75,7 +75,7 @@ protected Object newPrototypeInstance() throws BeansException {
7575
*/
7676
protected void destroyPrototypeInstance(Object target) {
7777
if (logger.isDebugEnabled()) {
78-
logger.debug("Destroying instance of bean '" + getTargetBeanName() + "'");
78+
logger.debug("Destroying instance of bean '" + this.targetBeanName + "'");
7979
}
8080
if (getBeanFactory() instanceof ConfigurableBeanFactory cbf) {
8181
cbf.destroyBean(getTargetBeanName(), target);
@@ -85,7 +85,7 @@ else if (target instanceof DisposableBean disposableBean) {
8585
disposableBean.destroy();
8686
}
8787
catch (Throwable ex) {
88-
logger.warn("Destroy method on bean with name '" + getTargetBeanName() + "' threw an exception", ex);
88+
logger.warn("Destroy method on bean with name '" + this.targetBeanName + "' threw an exception", ex);
8989
}
9090
}
9191
}

spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void releaseTarget(Object target) {
5454

5555
@Override
5656
public String toString() {
57-
return "PrototypeTargetSource for target bean with name '" + getTargetBeanName() + "'";
57+
return "PrototypeTargetSource for target bean with name '" + this.targetBeanName + "'";
5858
}
5959

6060
}

spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource
6161
new NamedThreadLocal<>("Thread-local instance of bean") {
6262
@Override
6363
public String toString() {
64-
return super.toString() + " '" + getTargetBeanName() + "'";
64+
return super.toString() + " '" + targetBeanName + "'";
6565
}
6666
};
6767

@@ -86,7 +86,7 @@ public Object getTarget() throws BeansException {
8686
Object target = this.targetInThread.get();
8787
if (target == null) {
8888
if (logger.isDebugEnabled()) {
89-
logger.debug("No target for prototype '" + getTargetBeanName() + "' bound to thread: " +
89+
logger.debug("No target for prototype '" + this.targetBeanName + "' bound to thread: " +
9090
"creating one and binding it to thread '" + Thread.currentThread().getName() + "'");
9191
}
9292
// Associate target with ThreadLocal.

0 commit comments

Comments
 (0)