Switch default value of spring.aop.proxy-target-class

This commit ensures that the default proxying value matches the opinion we
have applied for `@EnableTransactionManagement`

Closes gh-8786
pull/8658/merge
Stephane Nicoll 8 years ago
parent 6c6b9c284d
commit 78845fe63a

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2016 the original author or authors. * Copyright 2012-2017 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -45,14 +45,14 @@ public class AopAutoConfiguration {
@Configuration @Configuration
@EnableAspectJAutoProxy(proxyTargetClass = false) @EnableAspectJAutoProxy(proxyTargetClass = false)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "false", matchIfMissing = true) @ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "false", matchIfMissing = false)
public static class JdkDynamicAutoProxyConfiguration { public static class JdkDynamicAutoProxyConfiguration {
} }
@Configuration @Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true) @EnableAspectJAutoProxy(proxyTargetClass = true)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "true", matchIfMissing = false) @ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "true", matchIfMissing = true)
public static class CglibAutoProxyConfiguration { public static class CglibAutoProxyConfiguration {
} }

@ -43,7 +43,7 @@
"name": "spring.aop.proxy-target-class", "name": "spring.aop.proxy-target-class",
"type": "java.lang.Boolean", "type": "java.lang.Boolean",
"description": "Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false).", "description": "Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false).",
"defaultValue": false "defaultValue": true
}, },
{ {
"name": "spring.application.admin.enabled", "name": "spring.application.admin.enabled",

@ -60,7 +60,7 @@ public class AopAutoConfigurationTests {
@Test @Test
public void aopWithDefaultSettings() { public void aopWithDefaultSettings() {
load(TestConfiguration.class); load(TestConfiguration.class);
testProxyTargetClassDisabled(); testProxyTargetClassEnabled();
} }
@Test @Test

@ -50,7 +50,7 @@ content into your application; rather pick only the properties that you need.
# AOP # AOP
spring.aop.auto=true # Add @EnableAspectJAutoProxy. spring.aop.auto=true # Add @EnableAspectJAutoProxy.
spring.aop.proxy-target-class=false # Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false). spring.aop.proxy-target-class=true # Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false).
# IDENTITY ({sc-spring-boot}/context/ContextIdApplicationContextInitializer.{sc-ext}[ContextIdApplicationContextInitializer]) # IDENTITY ({sc-spring-boot}/context/ContextIdApplicationContextInitializer.{sc-ext}[ContextIdApplicationContextInitializer])
spring.application.index= # Application index. spring.application.index= # Application index.

Loading…
Cancel
Save