Skip to content

Commit

Permalink
Switch default value of spring.aop.proxy-target-class
Browse files Browse the repository at this point in the history
This commit ensures that the default proxying value matches the opinion we
have applied for `@EnableTransactionManagement`

Closes gh-8786
  • Loading branch information
snicoll committed Apr 4, 2017
1 parent 6c6b9c2 commit 78845fe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -45,14 +45,14 @@ public class AopAutoConfiguration {

@Configuration
@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 {

}

@Configuration
@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 {

}
Expand Down
Expand Up @@ -43,7 +43,7 @@
"name": "spring.aop.proxy-target-class",
"type": "java.lang.Boolean",
"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",
Expand Down
Expand Up @@ -60,7 +60,7 @@ public void aopDisabled() {
@Test
public void aopWithDefaultSettings() {
load(TestConfiguration.class);
testProxyTargetClassDisabled();
testProxyTargetClassEnabled();
}

@Test
Expand Down
Expand Up @@ -50,7 +50,7 @@ content into your application; rather pick only the properties that you need.
# AOP
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])
spring.application.index= # Application index.
Expand Down

0 comments on commit 78845fe

Please sign in to comment.