Skip to content

Commit 0110c5a

Browse files
committed
Merge branch '6.1.x'
2 parents 35278d0 + 6c08d93 commit 0110c5a

File tree

7 files changed

+23
-14
lines changed

7 files changed

+23
-14
lines changed

integration-tests/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void repositoryUsesAspectJAdviceMode() {
6262
// attempt was made to look up the AJ aspect. It's due to classpath issues
6363
// in integration-tests that it's not found.
6464
assertThatException().isThrownBy(ctx::refresh)
65-
.withMessageContaining("AspectJCachingConfiguration");
65+
.withMessageContaining("AspectJCachingConfiguration");
6666
}
6767

6868

integration-tests/src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,7 @@ void abstractApplicationContextValidatesRequiredPropertiesOnRefresh() {
541541
{
542542
ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext();
543543
ctx.getEnvironment().setRequiredProperties("foo", "bar");
544-
assertThatExceptionOfType(MissingRequiredPropertiesException.class).isThrownBy(
545-
ctx::refresh);
544+
assertThatExceptionOfType(MissingRequiredPropertiesException.class).isThrownBy(ctx::refresh);
546545
}
547546

548547
{

integration-tests/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ void repositoryUsesAspectJAdviceMode() {
9797
// this test is a bit fragile, but gets the job done, proving that an
9898
// attempt was made to look up the AJ aspect. It's due to classpath issues
9999
// in integration-tests that it's not found.
100-
assertThatException()
101-
.isThrownBy(ctx::refresh)
102-
.withMessageContaining("AspectJJtaTransactionManagementConfiguration");
100+
assertThatException().isThrownBy(ctx::refresh)
101+
.withMessageContaining("AspectJJtaTransactionManagementConfiguration");
103102
}
104103

105104
@Test

spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,16 @@ public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInsta
213213
return null;
214214
}
215215

216-
return new InstantiationModelAwarePointcutAdvisorImpl(expressionPointcut, candidateAdviceMethod,
217-
this, aspectInstanceFactory, declarationOrderInAspect, aspectName);
216+
try {
217+
return new InstantiationModelAwarePointcutAdvisorImpl(expressionPointcut, candidateAdviceMethod,
218+
this, aspectInstanceFactory, declarationOrderInAspect, aspectName);
219+
}
220+
catch (IllegalArgumentException | IllegalStateException ex) {
221+
if (logger.isDebugEnabled()) {
222+
logger.debug("Ignoring incompatible advice method: " + candidateAdviceMethod, ex);
223+
}
224+
return null;
225+
}
218226
}
219227

220228
@Nullable

spring-aspects/src/test/resources/org/springframework/aop/aspectj/autoproxy/ajcAutoproxyTests.xml

+6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22
<beans xmlns="http://www.springframework.org/schema/beans"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xmlns:aop="http://www.springframework.org/schema/aop"
5+
xmlns:cache="http://www.springframework.org/schema/cache"
56
xmlns:context="http://www.springframework.org/schema/context"
67
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-2.0.xsd
78
http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-2.0.xsd
9+
http://www.springframework.org/schema/cache https://www.springframework.org/schema/cache/spring-cache-3.1.xsd
810
http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context-2.5.xsd">
911

1012
<aop:aspectj-autoproxy/>
1113

1214
<context:spring-configured/>
1315

16+
<cache:annotation-driven mode="aspectj"/>
17+
18+
<bean id="cacheManager" class="org.springframework.cache.support.NoOpCacheManager"/>
19+
1420
<bean id="myAspect" class="org.springframework.aop.aspectj.autoproxy.CodeStyleAspect" factory-method="aspectOf">
1521
<property name="foo" value="bar"/>
1622
</bean>

spring-aspects/src/test/resources/org/springframework/cache/config/annotation-jcache-aspectj.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
</property>
2525
</bean>
2626

27-
<bean id="defaultCache"
28-
class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
27+
<bean id="defaultCache" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
2928
<property name="name" value="default"/>
3029
</bean>
3130

spring-aspects/src/test/resources/org/springframework/scheduling/aspectj/annotationDrivenContext.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
http://www.springframework.org/schema/task
88
https://www.springframework.org/schema/task/spring-task.xsd">
99

10-
<task:annotation-driven mode="aspectj" executor="testExecutor"
11-
exception-handler="testExceptionHandler"/>
10+
<task:annotation-driven mode="aspectj" executor="testExecutor" exception-handler="testExceptionHandler"/>
1211

1312
<task:executor id="testExecutor"/>
1413

15-
<bean id="testExceptionHandler"
16-
class="org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler"/>
14+
<bean id="testExceptionHandler" class="org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler"/>
1715

1816
</beans>

0 commit comments

Comments
 (0)