Fixed regression with fallback for non-resolvable property type

This commit is contained in:
Juergen Hoeller
2014-01-28 17:16:50 +01:00
parent 786e217991
commit 8570f607a7
3 changed files with 37 additions and 2 deletions

View File

@@ -628,7 +628,7 @@ public final class ResolvableType implements Serializable {
* Resolve this type to a {@link java.lang.Class}, returning the specified
* {@code fallback} if the type cannot be resolved. This method will consider bounds
* of {@link TypeVariable}s and {@link WildcardType}s if direct resolution fails;
* however, bounds of Object.class will be ignored.
* however, bounds of {@code Object.class} will be ignored.
* @param fallback the fallback class to use if resolution fails (may be {@code null})
* @return the resolved {@link Class} or the {@code fallback}
* @see #resolve()

View File

@@ -105,7 +105,7 @@ public class TypeDescriptor implements Serializable {
public TypeDescriptor(Property property) {
Assert.notNull(property, "Property must not be null");
this.resolvableType = ResolvableType.forMethodParameter(property.getMethodParameter());
this.type = this.resolvableType.resolve(Object.class);
this.type = this.resolvableType.resolve(property.getType());
this.annotations = nullSafeAnnotations(property.getAnnotations());
}