Polishing
This commit is contained in:
parent
d2108d2db6
commit
6bdf7ad36a
|
|
@ -123,7 +123,6 @@ public abstract class ClassFilters {
|
|||
public String toString() {
|
||||
return getClass().getName() + ": " + Arrays.toString(this.filters);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -164,7 +163,6 @@ public abstract class ClassFilters {
|
|||
public String toString() {
|
||||
return getClass().getName() + ": " + Arrays.toString(this.filters);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ class BeanDefinitionPropertyValueCodeGenerator {
|
|||
|
||||
BeanDefinitionPropertyValueCodeGenerator(GeneratedMethods generatedMethods,
|
||||
@Nullable BiFunction<Object, ResolvableType, CodeBlock> customValueGenerator) {
|
||||
|
||||
this.generatedMethods = generatedMethods;
|
||||
this.delegates = new ArrayList<>();
|
||||
if (customValueGenerator != null) {
|
||||
|
|
@ -143,7 +144,6 @@ class BeanDefinitionPropertyValueCodeGenerator {
|
|||
|
||||
@Nullable
|
||||
CodeBlock generateCode(Object value, ResolvableType type);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -163,7 +163,6 @@ class BeanDefinitionPropertyValueCodeGenerator {
|
|||
'\\', "\\\\"
|
||||
);
|
||||
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public CodeBlock generateCode(Object value, ResolvableType type) {
|
||||
|
|
@ -231,7 +230,6 @@ class BeanDefinitionPropertyValueCodeGenerator {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -321,8 +319,8 @@ class BeanDefinitionPropertyValueCodeGenerator {
|
|||
this.emptyResult = emptyResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@Nullable
|
||||
public CodeBlock generateCode(Object value, ResolvableType type) {
|
||||
if (this.collectionType.isInstance(value)) {
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
|||
* @see #getResource
|
||||
* @see Lazy
|
||||
*/
|
||||
protected Object buildLazyResourceProxy(final LookupElement element, final @Nullable String requestingBeanName) {
|
||||
protected Object buildLazyResourceProxy(LookupElement element, @Nullable String requestingBeanName) {
|
||||
TargetSource ts = new TargetSource() {
|
||||
@Override
|
||||
public Class<?> getTargetClass() {
|
||||
|
|
@ -525,16 +525,16 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
|||
String name = element.name;
|
||||
|
||||
if (factory instanceof AutowireCapableBeanFactory autowireCapableBeanFactory) {
|
||||
DependencyDescriptor descriptor = element.getDependencyDescriptor();
|
||||
if (this.fallbackToDefaultTypeMatch && element.isDefaultName && !factory.containsBean(name)) {
|
||||
autowiredBeanNames = new LinkedHashSet<>();
|
||||
resource = autowireCapableBeanFactory.resolveDependency(descriptor, requestingBeanName, autowiredBeanNames, null);
|
||||
resource = autowireCapableBeanFactory.resolveDependency(
|
||||
element.getDependencyDescriptor(), requestingBeanName, autowiredBeanNames, null);
|
||||
if (resource == null) {
|
||||
throw new NoSuchBeanDefinitionException(element.getLookupType(), "No resolvable resource object");
|
||||
}
|
||||
}
|
||||
else {
|
||||
resource = autowireCapableBeanFactory.resolveBeanByName(name, descriptor);
|
||||
resource = autowireCapableBeanFactory.resolveBeanByName(name, element.getDependencyDescriptor());
|
||||
autowiredBeanNames = Collections.singleton(name);
|
||||
}
|
||||
}
|
||||
|
|
@ -661,8 +661,6 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class representing injection information about an annotated field
|
||||
* or setter method, supporting the @Resource annotation.
|
||||
|
|
|
|||
|
|
@ -498,7 +498,6 @@ public class SpringFactoriesLoader {
|
|||
|
||||
/**
|
||||
* Strategy for resolving constructor arguments based on their type.
|
||||
*
|
||||
* @since 6.0
|
||||
* @see ArgumentResolver#of(Class, Object)
|
||||
* @see ArgumentResolver#ofSupplied(Class, Supplier)
|
||||
|
|
@ -595,13 +594,11 @@ public class SpringFactoriesLoader {
|
|||
*/
|
||||
static ArgumentResolver from(Function<Class<?>, Object> function) {
|
||||
return new ArgumentResolver() {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> T resolve(Class<T> type) {
|
||||
return (T) function.apply(type);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -609,7 +606,6 @@ public class SpringFactoriesLoader {
|
|||
|
||||
/**
|
||||
* Strategy for handling a failure that occurs when instantiating a factory.
|
||||
*
|
||||
* @since 6.0
|
||||
* @see FailureHandler#throwing()
|
||||
* @see FailureHandler#logging(Log)
|
||||
|
|
@ -671,7 +667,7 @@ public class SpringFactoriesLoader {
|
|||
static FailureHandler handleMessage(BiConsumer<Supplier<String>, Throwable> messageHandler) {
|
||||
return (factoryType, factoryImplementationName, failure) -> {
|
||||
Supplier<String> messageSupplier = () -> "Unable to instantiate factory class [%s] for factory type [%s]"
|
||||
.formatted(factoryImplementationName, factoryType.getName());
|
||||
.formatted(factoryImplementationName, factoryType.getName());
|
||||
messageHandler.accept(messageSupplier, failure);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue