Polishing
This commit is contained in:
parent
77f8408e80
commit
1f3ea5133f
|
|
@ -609,8 +609,8 @@ public abstract class BeanUtils {
|
|||
* @return a corresponding MethodParameter object
|
||||
*/
|
||||
public static MethodParameter getWriteMethodParameter(PropertyDescriptor pd) {
|
||||
if (pd instanceof GenericTypeAwarePropertyDescriptor) {
|
||||
return new MethodParameter(((GenericTypeAwarePropertyDescriptor) pd).getWriteMethodParameter());
|
||||
if (pd instanceof GenericTypeAwarePropertyDescriptor typeAwarePd) {
|
||||
return new MethodParameter(typeAwarePd.getWriteMethodParameter());
|
||||
}
|
||||
else {
|
||||
Method writeMethod = pd.getWriteMethod();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
|
|
@ -267,9 +267,8 @@ public class BeanWrapperImpl extends AbstractNestablePropertyAccessor implements
|
|||
|
||||
@Override
|
||||
public void setValue(@Nullable Object value) throws Exception {
|
||||
Method writeMethod = (this.pd instanceof GenericTypeAwarePropertyDescriptor ?
|
||||
((GenericTypeAwarePropertyDescriptor) this.pd).getWriteMethodForActualAccess() :
|
||||
this.pd.getWriteMethod());
|
||||
Method writeMethod = (this.pd instanceof GenericTypeAwarePropertyDescriptor typeAwarePd ?
|
||||
typeAwarePd.getWriteMethodForActualAccess() : this.pd.getWriteMethod());
|
||||
ReflectionUtils.makeAccessible(writeMethod);
|
||||
writeMethod.invoke(getWrappedInstance(), value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ import org.assertj.core.api.AssertProvider;
|
|||
import org.springframework.aot.agent.RecordedInvocation;
|
||||
|
||||
/**
|
||||
* A wrapper for {@link RecordedInvocation} that is the starting point for {@code RuntimeHints} AssertJ assertions.
|
||||
* A wrapper for {@link RecordedInvocation} that is the starting point for
|
||||
* {@code RuntimeHints} AssertJ assertions.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @since 6.0
|
||||
|
|
|
|||
|
|
@ -34,15 +34,15 @@ import org.springframework.core.io.support.SpringFactoriesLoader;
|
|||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* AssertJ {@link org.assertj.core.api.Assert assertions} that can be applied to an {@link RuntimeHintsInvocations}.
|
||||
* AssertJ {@link org.assertj.core.api.Assert assertions} that can be applied to
|
||||
* {@link RuntimeHintsInvocations}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @since 6.0
|
||||
*/
|
||||
public class RuntimeHintsInvocationsAssert extends AbstractAssert<RuntimeHintsInvocationsAssert, RuntimeHintsInvocations> {
|
||||
|
||||
|
||||
List<Consumer<RuntimeHints>> configurers = new ArrayList<>();
|
||||
private final List<Consumer<RuntimeHints>> configurers = new ArrayList<>();
|
||||
|
||||
RuntimeHintsInvocationsAssert(RuntimeHintsInvocations invocations) {
|
||||
super(invocations, RuntimeHintsInvocationsAssert.class);
|
||||
|
|
@ -123,5 +123,4 @@ public class RuntimeHintsInvocationsAssert extends AbstractAssert<RuntimeHintsIn
|
|||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue