@@ -509,10 +509,12 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
public void registerResolvableDependency(Class<?> dependencyType, Object autowiredValue) {
|
||||
Assert.notNull(dependencyType, "Type must not be null");
|
||||
Assert.notNull(dependencyType, "Dependency type must not be null");
|
||||
if (autowiredValue != null) {
|
||||
Assert.isTrue((autowiredValue instanceof ObjectFactory || dependencyType.isInstance(autowiredValue)),
|
||||
"Value [" + autowiredValue + "] does not implement specified type [" + dependencyType.getName() + "]");
|
||||
if (!(autowiredValue instanceof ObjectFactory || dependencyType.isInstance(autowiredValue))) {
|
||||
throw new IllegalArgumentException("Value [" + autowiredValue +
|
||||
"] does not implement specified dependency type [" + dependencyType.getName() + "]");
|
||||
}
|
||||
this.resolvableDependencies.put(dependencyType, autowiredValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user