Only cache by-type lookups if configuration has been marked as frozen
Issue: SPR-9448
This commit is contained in:
parent
d7e2de019f
commit
0f11920007
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue