From c1b396cca5650110a785d88107e7dad38f954689 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Fri, 17 Jun 2011 20:28:13 +0200 Subject: [PATCH] Replaced custom implementation over usage of TypeInformation.getActualType(). --- .../convert/MappingMongoConverter.java | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/convert/MappingMongoConverter.java b/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/convert/MappingMongoConverter.java index aeded467e..d18405737 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/convert/MappingMongoConverter.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/convert/MappingMongoConverter.java @@ -585,7 +585,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App return; } - Class reference = getValueType(type).getType(); + Class reference = type.getActualType().getType(); boolean notTheSameClass = !value.getClass().equals(reference); if (notTheSameClass) { @@ -593,24 +593,6 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App } } - /** - * Returns the type type information of the actual value to be stored. That is, for maps it will return the map value - * type, for collections it will return the component type as well as the given type if it is a non-collection or - * non-map one. - * - * @param type - * @return - */ - public TypeInformation getValueType(TypeInformation type) { - if (type.isMap()) { - return type.getMapValueType(); - } else if (type.isCollectionLike()) { - return type.getComponentType(); - } else { - return type; - } - } - /** * Writes the given simple value to the given {@link DBObject}. Will store enum names for enum values. *