Browse Source
Prior to this commit, DefaultListableBeanFactory's determineHighestPriorityCandidate() method sometimes failed to determine the highest priority candidate if duplicate priority candidates were detected whose priority was not the highest priority in the candidate set. In addition, the bean registration order affected the outcome of the algorithm: if the highest priority was detected before other duplicate priorities were detected, the algorithm succeeded in determining the highest priority candidate. This commit addresses those shortcomings by ignoring duplicate @Priority values unless the duplication is for the highest priority encountered, in which case a NoUniqueBeanDefinitionException is still thrown to signal that multiple beans were found with the same "highest priority". Closes gh-33733pull/33766/head
2 changed files with 91 additions and 7 deletions
Loading…
Reference in new issue