Skip to content

Commit 7f79ccb

Browse files
committed
Combine conditions for better readability and simplicity
1 parent 43c2e51 commit 7f79ccb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator {
4242
@Override
4343
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
4444
boolean proxyTargetClass = true;
45-
if (node instanceof Element ele) {
46-
if (ele.hasAttribute(PROXY_TARGET_CLASS)) {
47-
proxyTargetClass = Boolean.parseBoolean(ele.getAttribute(PROXY_TARGET_CLASS));
48-
}
45+
if (node instanceof Element ele && ele.hasAttribute(PROXY_TARGET_CLASS)) {
46+
proxyTargetClass = Boolean.parseBoolean(ele.getAttribute(PROXY_TARGET_CLASS));
4947
}
5048

5149
// Register the original bean definition as it will be referenced by the scoped proxy

0 commit comments

Comments
 (0)