SimpleAliasRegistry detects circles between non-canonical aliases as well (through hasAlias)
Additionally, as an optimization, we skip the re-registration step for existing aliases now. Issue: SPR-13390
This commit is contained in:
@@ -788,6 +788,15 @@ public class DefaultListableBeanFactoryTests {
|
||||
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
|
||||
lbf.registerAlias("test", "test2");
|
||||
lbf.registerAlias("test2", "test3");
|
||||
|
||||
try {
|
||||
lbf.registerAlias("test3", "test2");
|
||||
fail("Should have thrown IllegalStateException");
|
||||
}
|
||||
catch (IllegalStateException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
try {
|
||||
lbf.registerAlias("test3", "test");
|
||||
fail("Should have thrown IllegalStateException");
|
||||
@@ -795,6 +804,8 @@ public class DefaultListableBeanFactoryTests {
|
||||
catch (IllegalStateException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
lbf.registerAlias("test", "test3");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user