Merge branch '6.2.x'

# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
This commit is contained in:
Juergen Hoeller
2025-07-07 14:40:50 +02:00
4 changed files with 43 additions and 10 deletions
@@ -364,6 +364,16 @@ class AspectJAutoProxyCreatorTests {
}
}
@Test
void nullAdviceIsSkipped() {
try (ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(ProxyWithNullAdviceConfig.class)) {
@SuppressWarnings("unchecked")
Supplier<String> supplier = context.getBean(Supplier.class);
assertThat(AopUtils.isAopProxy(supplier)).as("AOP proxy").isTrue();
assertThat(supplier.get()).isEqualTo("lambda");
}
}
private ClassPathXmlApplicationContext newContext(String fileSuffix) {
return new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-" + fileSuffix, getClass());
}
@@ -627,6 +637,16 @@ class ProxyTargetClassFalseConfig extends AbstractProxyTargetClassConfig {
class ProxyTargetClassTrueConfig extends AbstractProxyTargetClassConfig {
}
@Configuration(proxyBeanMethods = false)
@EnableAspectJAutoProxy(proxyTargetClass = true)
class ProxyWithNullAdviceConfig extends AbstractProxyTargetClassConfig {
@Override
SupplierAdvice supplierAdvice() {
return null;
}
}
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
class PerTargetProxyTargetClassTrueConfig {