From addeb858e130dc8e63cd80a3c7f862c35b1801d0 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 26 May 2020 09:04:51 +0200 Subject: [PATCH] DATACMNS-1706 - Polishing. Improve Javadoc. Original pull request: #437. --- .../springframework/data/mapping/PreferredConstructor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/data/mapping/PreferredConstructor.java b/src/main/java/org/springframework/data/mapping/PreferredConstructor.java index c3b54d7dd..8432002d0 100644 --- a/src/main/java/org/springframework/data/mapping/PreferredConstructor.java +++ b/src/main/java/org/springframework/data/mapping/PreferredConstructor.java @@ -118,7 +118,7 @@ public class PreferredConstructor> { * {@link PersistentEntity} backing this {@link PreferredConstructor}. * * @param property must not be {@literal null}. - * @return + * @return {@literal true} if the {@link PersistentProperty} is used in the constructor. */ public boolean isConstructorParameter(PersistentProperty property) { @@ -148,7 +148,7 @@ public class PreferredConstructor> { * constructor argument of the enclosing class type. * * @param parameter must not be {@literal null}. - * @return + * @return {@literal true} if the {@link PersistentProperty} maps to the enclosing class. */ public boolean isEnclosingClassParameter(Parameter parameter) { @@ -212,6 +212,7 @@ public class PreferredConstructor> { this.hasSpelExpression = Lazy.of(() -> StringUtils.hasText(getSpelExpression())); } + @Nullable private static String getValue(Annotation[] annotations) { return Arrays.stream(annotations)// @@ -279,7 +280,7 @@ public class PreferredConstructor> { P referencedProperty = entity == null ? null : name == null ? null : entity.getPersistentProperty(name); - return property != null && property.equals(referencedProperty); + return property.equals(referencedProperty); } private boolean isEnclosingClassParameter() {