Skip to content

Commit 1f3ea51

Browse files
committed
Polishing
1 parent 77f8408 commit 1f3ea51

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

spring-beans/src/main/java/org/springframework/beans/BeanUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ public static Class<?> findPropertyType(String propertyName, @Nullable Class<?>.
609609
* @return a corresponding MethodParameter object
610610
*/
611611
public static MethodParameter getWriteMethodParameter(PropertyDescriptor pd) {
612-
if (pd instanceof GenericTypeAwarePropertyDescriptor) {
613-
return new MethodParameter(((GenericTypeAwarePropertyDescriptor) pd).getWriteMethodParameter());
612+
if (pd instanceof GenericTypeAwarePropertyDescriptor typeAwarePd) {
613+
return new MethodParameter(typeAwarePd.getWriteMethodParameter());
614614
}
615615
else {
616616
Method writeMethod = pd.getWriteMethod();

spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -267,9 +267,8 @@ public Object getValue() throws Exception {
267267

268268
@Override
269269
public void setValue(@Nullable Object value) throws Exception {
270-
Method writeMethod = (this.pd instanceof GenericTypeAwarePropertyDescriptor ?
271-
((GenericTypeAwarePropertyDescriptor) this.pd).getWriteMethodForActualAccess() :
272-
this.pd.getWriteMethod());
270+
Method writeMethod = (this.pd instanceof GenericTypeAwarePropertyDescriptor typeAwarePd ?
271+
typeAwarePd.getWriteMethodForActualAccess() : this.pd.getWriteMethod());
273272
ReflectionUtils.makeAccessible(writeMethod);
274273
writeMethod.invoke(getWrappedInstance(), value);
275274
}

spring-core-test/src/main/java/org/springframework/aot/test/agent/RuntimeHintsInvocations.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
import org.springframework.aot.agent.RecordedInvocation;
2525

2626
/**
27-
* A wrapper for {@link RecordedInvocation} that is the starting point for {@code RuntimeHints} AssertJ assertions.
27+
* A wrapper for {@link RecordedInvocation} that is the starting point for
28+
* {@code RuntimeHints} AssertJ assertions.
2829
*
2930
* @author Brian Clozel
3031
* @since 6.0

spring-core-test/src/main/java/org/springframework/aot/test/agent/RuntimeHintsInvocationsAssert.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
import org.springframework.util.Assert;
3535

3636
/**
37-
* AssertJ {@link org.assertj.core.api.Assert assertions} that can be applied to an {@link RuntimeHintsInvocations}.
37+
* AssertJ {@link org.assertj.core.api.Assert assertions} that can be applied to
38+
* {@link RuntimeHintsInvocations}.
3839
*
3940
* @author Brian Clozel
4041
* @since 6.0
4142
*/
4243
public class RuntimeHintsInvocationsAssert extends AbstractAssert<RuntimeHintsInvocationsAssert, RuntimeHintsInvocations> {
4344

44-
45-
List<Consumer<RuntimeHints>> configurers = new ArrayList<>();
45+
private final List<Consumer<RuntimeHints>> configurers = new ArrayList<>();
4646

4747
RuntimeHintsInvocationsAssert(RuntimeHintsInvocations invocations) {
4848
super(invocations, RuntimeHintsInvocationsAssert.class);
@@ -123,5 +123,4 @@ public RuntimeHintsInvocationsAssert hasCount(long count) {
123123
return this;
124124
}
125125

126-
127126
}

0 commit comments

Comments
 (0)