From d45f74324819ff7dce4d879ce9eeb594a6619add Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 24 Jul 2014 12:13:37 +0200 Subject: [PATCH] TypeDescriptor's getResolvableType() and getSource() are @since 4.0 (cherry picked from commit 0ce90f1) --- .../core/convert/TypeDescriptor.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java index 89b7a4a634..bfc2b22e96 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java +++ b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java @@ -129,19 +129,21 @@ public class TypeDescriptor implements Serializable { } /** - * Variation of {@link #getType()} that accounts for a primitive type by returning its object wrapper type. - *

This is useful for conversion service implementations that wish to normalize to object-based types - * and not work with primitive types directly. + * Variation of {@link #getType()} that accounts for a primitive type by + * returning its object wrapper type. + *

This is useful for conversion service implementations that wish to + * normalize to object-based types and not work with primitive types directly. */ public Class getObjectType() { return ClassUtils.resolvePrimitiveIfNecessary(getType()); } /** - * The type of the backing class, method parameter, field, or property described by this TypeDescriptor. + * The type of the backing class, method parameter, field, or property + * described by this TypeDescriptor. *

Returns primitive types as-is. - *

See {@link #getObjectType()} for a variation of this operation that resolves primitive types - * to their corresponding Object types if necessary. + *

See {@link #getObjectType()} for a variation of this operation that + * resolves primitive types to their corresponding Object types if necessary. * @return the type, or {@code null} * @see #getObjectType() */ @@ -151,6 +153,7 @@ public class TypeDescriptor implements Serializable { /** * Return the underlying {@link ResolvableType}. + * @since 4.0 */ public ResolvableType getResolvableType() { return this.resolvableType; @@ -161,9 +164,10 @@ public class TypeDescriptor implements Serializable { * {@link MethodParameter} or {@link Type} depending on how the {@link TypeDescriptor} * was constructed. This method is primarily to provide access to additional * type information or meta-data that alternative JVM languages may provide. + * @since 4.0 */ public Object getSource() { - return (this.resolvableType == null ? null : this.resolvableType.getSource()); + return (this.resolvableType != null ? this.resolvableType.getSource() : null); } /** @@ -234,7 +238,7 @@ public class TypeDescriptor implements Serializable { * @return true if the annotation is present */ public boolean hasAnnotation(Class annotationType) { - return getAnnotation(annotationType) != null; + return (getAnnotation(annotationType) != null); } /**