Fix new Sonar smells; revert to BUILD-SNAPSHOTs

This commit is contained in:
Artem Bilan
2019-06-15 10:59:36 -04:00
parent 62859256d4
commit a77dac5347
3 changed files with 18 additions and 17 deletions

View File

@@ -175,23 +175,22 @@ class DefaultConfiguringBeanFactoryPostProcessor
private void registerNullChannel() {
if (this.beanFactory.containsBean(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)) {
BeanDefinition nullChannelDefinition = null;
BeanFactory beanFactory = this.beanFactory;
BeanFactory beanFactoryToUse = this.beanFactory;
do {
if (beanFactory instanceof ConfigurableListableBeanFactory) {
ConfigurableListableBeanFactory listable = (ConfigurableListableBeanFactory) beanFactory;
if (beanFactoryToUse instanceof ConfigurableListableBeanFactory) {
ConfigurableListableBeanFactory listable = (ConfigurableListableBeanFactory) beanFactoryToUse;
if (listable.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)) {
nullChannelDefinition = listable
.getBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME);
}
}
if (beanFactory instanceof HierarchicalBeanFactory) {
beanFactory = ((HierarchicalBeanFactory) beanFactory).getParentBeanFactory();
if (beanFactoryToUse instanceof HierarchicalBeanFactory) {
beanFactoryToUse = ((HierarchicalBeanFactory) beanFactoryToUse).getParentBeanFactory();
}
}
while (nullChannelDefinition == null);
if (nullChannelDefinition != null &&
!NullChannel.class.getName().equals(nullChannelDefinition.getBeanClassName())) {
if (!NullChannel.class.getName().equals(nullChannelDefinition.getBeanClassName())) {
throw new IllegalStateException("The bean name '" + IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME
+ "' is reserved.");
}