Combine conditions for better readability and simplicity

This commit is contained in:
achhibi 2023-12-14 20:29:09 +01:00
parent 43c2e51d6e
commit 7f79ccbec0
1 changed files with 2 additions and 4 deletions

View File

@ -42,10 +42,8 @@ class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator {
@Override
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
boolean proxyTargetClass = true;
if (node instanceof Element ele) {
if (ele.hasAttribute(PROXY_TARGET_CLASS)) {
proxyTargetClass = Boolean.parseBoolean(ele.getAttribute(PROXY_TARGET_CLASS));
}
if (node instanceof Element ele && ele.hasAttribute(PROXY_TARGET_CLASS)) {
proxyTargetClass = Boolean.parseBoolean(ele.getAttribute(PROXY_TARGET_CLASS));
}
// Register the original bean definition as it will be referenced by the scoped proxy