take element/key/value objects into account for the best possible type descriptor

This commit is contained in:
Juergen Hoeller
2011-12-12 00:44:38 +00:00
parent 7398e0ea97
commit 4a7b96c4ca
2 changed files with 5 additions and 5 deletions

View File

@@ -324,7 +324,7 @@ public class TypeDescriptor {
*/
public TypeDescriptor getMapKeyTypeDescriptor(Object key) {
TypeDescriptor keyType = getMapKeyTypeDescriptor();
return (keyType != TypeDescriptor.UNKNOWN ? keyType : TypeDescriptor.forObject(key));
return (!TypeDescriptor.UNKNOWN.equals(keyType) ? keyType : TypeDescriptor.forObject(key));
}
/**
@@ -353,7 +353,7 @@ public class TypeDescriptor {
*/
public TypeDescriptor getMapValueTypeDescriptor(Object value) {
TypeDescriptor valueType = getMapValueTypeDescriptor();
return (valueType != TypeDescriptor.UNKNOWN ? valueType : TypeDescriptor.forObject(value));
return (!TypeDescriptor.UNKNOWN.equals(valueType) ? valueType : TypeDescriptor.forObject(value));
}
/**