From 033c46fc192eef9ffbdf108e5b7fba6fca8e6929 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Wed, 17 Oct 2018 08:10:25 +0200 Subject: [PATCH] DATAJPA-1443 - Polishing. Original pull request: #295. Fixed more JavaDoc warnings by completing parameter and return value description. --- .../data/jpa/domain/Specifications.java | 12 ++++++------ .../data/jpa/util/HibernateProxyDetector.java | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/springframework/data/jpa/domain/Specifications.java b/src/main/java/org/springframework/data/jpa/domain/Specifications.java index 1d88bf4f4..a910e5a4e 100644 --- a/src/main/java/org/springframework/data/jpa/domain/Specifications.java +++ b/src/main/java/org/springframework/data/jpa/domain/Specifications.java @@ -55,9 +55,9 @@ public class Specifications implements Specification, Serializable { * Simple static factory method to add some syntactic sugar around a {@link Specification}. * * @deprecated since 2.0, use {@link Specification#where} instead - * @param + * @param type parameter for the specification parameter. * @param spec can be {@literal null}. - * @return + * @return a new Specifcations instance. Guaranteed to be not {@code null}. */ @Deprecated public static Specifications where(@Nullable Specification spec) { @@ -69,7 +69,7 @@ public class Specifications implements Specification, Serializable { * * @deprecated since 2.0, use {@link Specification#and} instead * @param other can be {@literal null}. - * @return + * @return a new Specifications instance combining this and the parameter instance. Guaranteed to be not {@code null}. */ @Deprecated public Specifications and(@Nullable Specification other) { @@ -81,7 +81,7 @@ public class Specifications implements Specification, Serializable { * * @deprecated since 2.0, use {@link Specification#or} instead * @param other can be {@literal null}. - * @return + * @return a new Specifications instance combining this and the parameter instance. Guaranteed to be not {@code null}. */ @Deprecated public Specifications or(@Nullable Specification other) { @@ -92,9 +92,9 @@ public class Specifications implements Specification, Serializable { * Negates the given {@link Specification}. * * @deprecated since 2.0, use {@link Specification#not} instead - * @param + * @param type parameter for the specification parameter. * @param spec can be {@literal null}. - * @return + * @return a new Specifications instance combining this and the parameter instance. Guaranteed to be not {@code null}. */ @Deprecated public static Specifications not(@Nullable Specification spec) { diff --git a/src/main/java/org/springframework/data/jpa/util/HibernateProxyDetector.java b/src/main/java/org/springframework/data/jpa/util/HibernateProxyDetector.java index 2619c0fff..3027edf7e 100644 --- a/src/main/java/org/springframework/data/jpa/util/HibernateProxyDetector.java +++ b/src/main/java/org/springframework/data/jpa/util/HibernateProxyDetector.java @@ -19,6 +19,7 @@ import java.util.Optional; import org.hibernate.proxy.HibernateProxy; import org.springframework.data.util.ProxyUtils.ProxyDetector; +import org.springframework.lang.Nullable; import org.springframework.util.ClassUtils; /** @@ -43,7 +44,8 @@ class HibernateProxyDetector implements ProxyDetector { .orElse(type); } - private static final Class loadHibernateProxyType() { + @Nullable + private static Class loadHibernateProxyType() { try { return ClassUtils.forName("org.hibernate.proxy.HibernateProxy", HibernateProxyDetector.class.getClassLoader());