Fix alias resolution error message in SimpleAliasRegistry

Prior to this commit, the alias resolution error message in
SimpleAliasRegistry was misleading.

When a resolution conflict is detected, the IllegalStateException
thrown by resolveAliases(...) now states that the resolved alias is
already registered for an `existingName` instead of the `registeredName`.

See gh-31353
Closes gh-32025
This commit is contained in:
Sam Brannen
2024-01-14 15:19:04 +01:00
parent 5d309d5724
commit 7daff59cb1
2 changed files with 12 additions and 24 deletions

View File

@@ -172,7 +172,7 @@ public class SimpleAliasRegistry implements AliasRegistry {
throw new IllegalStateException(
"Cannot register resolved alias '" + resolvedAlias + "' (original: '" + alias +
"') for name '" + resolvedName + "': It is already registered for name '" +
registeredName + "'.");
existingName + "'.");
}
checkForAliasCircle(resolvedName, resolvedAlias);
this.aliasMap.remove(alias);