Implement additional micro performance optimizations
See gh-34717
This commit is contained in:
@@ -364,9 +364,9 @@ class ConfigurationClassEnhancer {
|
||||
// proxy that intercepts calls to getObject() and returns any cached bean instance.
|
||||
// This ensures that the semantics of calling a FactoryBean from within @Bean methods
|
||||
// is the same as that of referring to a FactoryBean within XML. See SPR-6602.
|
||||
if (factoryContainsBean(beanFactory, BeanFactory.FACTORY_BEAN_PREFIX + beanName) &&
|
||||
factoryContainsBean(beanFactory, beanName)) {
|
||||
Object factoryBean = beanFactory.getBean(BeanFactory.FACTORY_BEAN_PREFIX + beanName);
|
||||
String factoryBeanName = BeanFactory.FACTORY_BEAN_PREFIX + beanName;
|
||||
if (factoryContainsBean(beanFactory, factoryBeanName) && factoryContainsBean(beanFactory, beanName)) {
|
||||
Object factoryBean = beanFactory.getBean(factoryBeanName);
|
||||
if (factoryBean instanceof ScopedProxyFactoryBean) {
|
||||
// Scoped proxy factory beans are a special case and should not be further proxied
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 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.
|
||||
@@ -932,8 +932,8 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
|
||||
*/
|
||||
private boolean isExcluded(String beanName) {
|
||||
return (this.excludedBeans.contains(beanName) ||
|
||||
(beanName.startsWith(BeanFactory.FACTORY_BEAN_PREFIX) &&
|
||||
this.excludedBeans.contains(beanName.substring(BeanFactory.FACTORY_BEAN_PREFIX.length()))));
|
||||
(!beanName.isEmpty() && (beanName.charAt(0) == BeanFactory.FACTORY_BEAN_PREFIX_CHAR) &&
|
||||
this.excludedBeans.contains(beanName.substring(1)))); // length of '&'
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user