From 8a326a871399c8bbf7dea575e5076e513e21f9bb Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 1 Mar 2017 14:36:26 +0000 Subject: [PATCH] Simplify BeanTypeRegistry by requiring a DefaultListableBeanFactory Closes gh-8439 --- .../condition/BeanTypeRegistry.java | 295 +++++++----------- .../condition/OnBeanCondition.java | 2 +- 2 files changed, 114 insertions(+), 183 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java index 1e57dd3f74d..fc6ee6d46c6 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.beans.factory.CannotLoadBeanClassException; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.ListableBeanFactory; @@ -43,13 +42,14 @@ import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.core.ResolvableType; import org.springframework.core.type.MethodMetadata; import org.springframework.core.type.StandardMethodMetadata; +import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.ReflectionUtils; import org.springframework.util.StringUtils; /** - * A registry of the bean types that are contained in a {@link ListableBeanFactory}. - * Provides similar functionality to + * A registry of the bean types that are contained in a + * {@link DefaultListableBeanFactory}. Provides similar functionality to * {@link ListableBeanFactory#getBeanNamesForType(Class, boolean, boolean)} but is * optimized for use by {@link OnBeanCondition} based on the following assumptions: *