Skip to content

Commit 6e0400d

Browse files
committed
Polish Property class
1 parent fac060f commit 6e0400d

File tree

1 file changed

+3
-9
lines changed
  • spring-core/src/main/java/org/springframework/core/convert

1 file changed

+3
-9
lines changed

spring-core/src/main/java/org/springframework/core/convert/Property.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* The built TypeDescriptor can then be used to convert from/to the property type.
3838
*
3939
* @author Keith Donald
40+
* @author Phillip Webb
4041
* @since 3.1
4142
* @see TypeDescriptor#TypeDescriptor(Property)
4243
* @see TypeDescriptor#nested(Property, int)
@@ -53,8 +54,7 @@ public final class Property {
5354

5455
private final MethodParameter methodParameter;
5556

56-
private final Annotation[] annotations;
57-
57+
private Annotation[] annotations;
5858

5959
public Property(Class<?> objectType, Method readMethod, Method writeMethod) {
6060
this(objectType, readMethod, writeMethod, null);
@@ -65,13 +65,7 @@ public Property(Class<?> objectType, Method readMethod, Method writeMethod, Stri
6565
this.readMethod = readMethod;
6666
this.writeMethod = writeMethod;
6767
this.methodParameter = resolveMethodParameter();
68-
if (name != null) {
69-
this.name = name;
70-
}
71-
else {
72-
this.name = resolveName();
73-
}
74-
this.annotations = resolveAnnotations();
68+
this.name = (name == null ? resolveName() : name);
7569
}
7670

7771

0 commit comments

Comments
 (0)