polish
This commit is contained in:
parent
3ef485bbbe
commit
5c3e71d494
|
|
@ -40,7 +40,6 @@ public class ConverterNotFoundException extends ConversionException {
|
|||
this.targetType = targetType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the source type that was requested to convert from.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ public class TypeDescriptor {
|
|||
*/
|
||||
public static final TypeDescriptor NULL = new TypeDescriptor();
|
||||
|
||||
|
||||
private Class<?> type;
|
||||
|
||||
private MethodParameter methodParameter;
|
||||
|
|
@ -51,7 +50,6 @@ public class TypeDescriptor {
|
|||
|
||||
private Annotation[] cachedFieldAnnotations;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new descriptor for the given type.
|
||||
* <p>Use this constructor when a conversion point comes from a source such as a Map
|
||||
|
|
@ -90,7 +88,6 @@ public class TypeDescriptor {
|
|||
private TypeDescriptor() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the wrapped MethodParameter, if any.
|
||||
* <p>Note: Either MethodParameter or Field is available.
|
||||
|
|
@ -132,8 +129,8 @@ public class TypeDescriptor {
|
|||
* Determine the declared type of the wrapped parameter/field.
|
||||
* Returns the Object wrapper type if the underlying type is a primitive.
|
||||
*/
|
||||
public Class getObjectType() {
|
||||
Class type = getType();
|
||||
public Class<?> getObjectType() {
|
||||
Class<?> type = getType();
|
||||
return type != null ? ClassUtils.resolvePrimitiveIfNecessary(type) : type;
|
||||
}
|
||||
|
||||
|
|
@ -336,8 +333,7 @@ public class TypeDescriptor {
|
|||
* @param type the class
|
||||
* @return the type descriptor
|
||||
*/
|
||||
public static TypeDescriptor valueOf(Class type) {
|
||||
// TODO needs a cache for common type descriptors
|
||||
public static TypeDescriptor valueOf(Class<?> type) {
|
||||
return (type != null ? new TypeDescriptor(type) : NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue