Only cache by-type lookups if configuration has been marked as frozen
Issue: SPR-9448
This commit is contained in:
@@ -2173,11 +2173,13 @@ public class DefaultListableBeanFactoryTests {
|
||||
public void testByTypeLookupIsFastEnough() {
|
||||
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
|
||||
|
||||
for (int i=0; i<1000; i++) {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
bf.registerBeanDefinition("a"+i, new RootBeanDefinition(A.class));
|
||||
}
|
||||
bf.registerBeanDefinition("b", new RootBeanDefinition(B.class));
|
||||
|
||||
bf.freezeConfiguration();
|
||||
|
||||
for (int i=0; i<10000; i++) {
|
||||
bf.getBean(B.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user