26398
merge the three filtering step to one for statement the main code is below
// Separate between BeanPostProcessors that implement PriorityOrdered,
// Ordered, and the rest.
List<BeanPostProcessor> priorityOrderedPostProcessors = new ArrayList<>();
List<BeanPostProcessor> internalPostProcessors = new ArrayList<>();
List<BeanPostProcessor> orderedPostProcessors = new ArrayList<>();
List<BeanPostProcessor> nonOrderedPostProcessors = new ArrayList<>();
for (String ppName : postProcessorNames) {
BeanPostProcessor pp = beanFactory.getBean(ppName, BeanPostProcessor.class);
if (pp instanceof MergedBeanDefinitionPostProcessor) {
internalPostProcessors.add(pp);
}
else if (beanFactory.isTypeMatch(ppName, PriorityOrdered.class)) {
priorityOrderedPostProcessors.add(pp);
}
else if (beanFactory.isTypeMatch(ppName, Ordered.class)) {
orderedPostProcessors.add(pp);
}
else {
nonOrderedPostProcessors.add(pp);
}
}
with merging the filtering,
- the goal of this function is more distinct
- can save unnecessary code
- save more space as no need to use List<String> orderedPostProcessorNames
- achieve the goal with only one for statement
Comment From: pivotal-issuemaster
@Jirath-Liu Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-issuemaster
@Jirath-Liu Thank you for signing the Contributor License Agreement!
Comment From: sbrannen
Thanks for PR.
Unfortunately, the proposal changes the order in which PriorityOrdered, Ordered, and non-ordered BeanPostProcessors are instantiated which constitutes a breaking change.
In light of that, I am closing this PR.
For additional information, please see all declined PRs involving proposed changes to PostProcessorRegistrationDelegate.