Polishing

This commit is contained in:
Juergen Hoeller
2024-10-16 11:35:23 +02:00
parent a228eb8bd6
commit feb6a5f52d
12 changed files with 75 additions and 124 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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,9 +29,11 @@ import org.springframework.util.ObjectUtils;
/**
* A simple descriptor for an injection point, pointing to a method/constructor
* parameter or a field. Exposed by {@link UnsatisfiedDependencyException}.
* Also available as an argument for factory methods, reacting to the
* requesting injection point for building a customized bean instance.
* parameter or a field.
*
* <p>Exposed by {@link UnsatisfiedDependencyException}. Also available as an
* argument for factory methods, reacting to the requesting injection point
* for building a customized bean instance.
*
* @author Juergen Hoeller
* @since 4.3

View File

@@ -64,8 +64,8 @@ class DefaultBeanRegistrationCodeFragments implements BeanRegistrationCodeFragme
private final Supplier<InstantiationDescriptor> instantiationDescriptor;
DefaultBeanRegistrationCodeFragments(BeanRegistrationsCode beanRegistrationsCode,
RegisteredBean registeredBean,
DefaultBeanRegistrationCodeFragments(
BeanRegistrationsCode beanRegistrationsCode, RegisteredBean registeredBean,
BeanDefinitionMethodGeneratorFactory beanDefinitionMethodGeneratorFactory) {
this.beanRegistrationsCode = beanRegistrationsCode;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@@ -148,10 +148,10 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
this.parameterTypes = original.parameterTypes;
this.parameterIndex = original.parameterIndex;
this.fieldName = original.fieldName;
this.containingClass = original.containingClass;
this.required = original.required;
this.eager = original.eager;
this.nestingLevel = original.nestingLevel;
this.containingClass = original.containingClass;
}

View File

@@ -488,8 +488,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
return namedBean.getBeanInstance();
}
BeanFactory parent = getParentBeanFactory();
if (parent instanceof DefaultListableBeanFactory dlfb) {
return dlfb.resolveBean(requiredType, args, nonUniqueAsNull);
if (parent instanceof DefaultListableBeanFactory dlbf) {
return dlbf.resolveBean(requiredType, args, nonUniqueAsNull);
}
else if (parent != null) {
ObjectProvider<T> parentProvider = parent.getBeanProvider(requiredType);