Permalink
Browse files

Removed unused ObjectMapper.

  • Loading branch information...
1 parent a4ab3ec commit 4275fe911bc2bee5a3a45624c01b282388cc7445 @pgelinas pgelinas committed May 17, 2012
@@ -9,7 +9,6 @@
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.BeanDeserializer;
import com.fasterxml.jackson.databind.deser.ResolvableDeserializer;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
@@ -29,18 +28,15 @@
private final BeanDeserializer delegate;
private final List<ConstructibleAnnotatedCollection> backReferencedFields;
private final Class<?> clazz;
- private final ObjectMapper objectMapper;
public BackReferencedBeanDeserializer(BeanDeserializer deserializer,
List<ConstructibleAnnotatedCollection> fields,
- CouchDbConnector couchDbConnector, Class<?> clazz,
- ObjectMapper objectMapper) {
+ CouchDbConnector couchDbConnector, Class<?> clazz) {
super(clazz);
this.clazz = clazz;
this.delegate = deserializer;
this.couchDbConnector = couchDbConnector;
this.backReferencedFields = fields;
- this.objectMapper = objectMapper;
}
@Override
@@ -64,12 +60,11 @@ private void addbackReferencedFields(Object deserializedObject,
if (ann.fetch().equals(FetchType.EAGER)) {
handler = new ViewBasedCollection(id, couchDbConnector,
- clazz, ann, constructibleField, objectMapper);
+ clazz, ann, constructibleField);
handler.initialize();
} else {
handler = new LazyLoadingViewBasedCollection(id,
- couchDbConnector, clazz, ann, constructibleField,
- objectMapper);
+ couchDbConnector, clazz, ann, constructibleField);
}
@@ -2,7 +2,6 @@
import java.lang.reflect.*;
-import com.fasterxml.jackson.databind.ObjectMapper;
import org.ektorp.*;
import org.ektorp.docref.*;
@@ -14,12 +13,11 @@
public LazyLoadingViewBasedCollection(String id,
CouchDbConnector couchDbConnector, Class<?> clazz,
DocumentReferences documentReferences,
- ConstructibleAnnotatedCollection constructibleField,
- ObjectMapper objectMapper) throws IllegalArgumentException,
+ ConstructibleAnnotatedCollection constructibleField) throws IllegalArgumentException,
InstantiationException, IllegalAccessException,
InvocationTargetException {
super(id, couchDbConnector, clazz, documentReferences,
- constructibleField, objectMapper);
+ constructibleField);
lazyReferences = true;
}
@@ -6,7 +6,6 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.CollectionType;
import org.ektorp.*;
import org.ektorp.docref.*;
@@ -23,13 +22,11 @@
final DocumentReferences referenceMetaData;
final ConstructibleAnnotatedCollection constructibleAnnotatedCollection;
final Collection<?> collection;
- final ObjectMapper objectMapper;
private final Collection<BulkDeleteDocument> pendingRemoval = new LinkedHashSet<BulkDeleteDocument>();
public ViewBasedCollection(String id, CouchDbConnector couchDbConnector,
Class<?> clazz, DocumentReferences documentReferences,
- ConstructibleAnnotatedCollection constructibleField,
- ObjectMapper objectMapper) throws IllegalArgumentException,
+ ConstructibleAnnotatedCollection constructibleField) throws IllegalArgumentException,
InstantiationException, IllegalAccessException,
InvocationTargetException {
this.id = id;
@@ -38,7 +35,6 @@ public ViewBasedCollection(String id, CouchDbConnector couchDbConnector,
this.referenceMetaData = documentReferences;
this.constructibleAnnotatedCollection = constructibleField;
this.collection = constructibleField.getConstructor().newInstance();
- this.objectMapper = objectMapper;
}
private List<?> loadFromBackReferences(String thisId,
@@ -63,7 +63,7 @@ public EktorpBeanDeserializerModifier(CouchDbConnector db, ObjectMapper objectMa
if (!fields.isEmpty()) {
return new BackReferencedBeanDeserializer(
(BeanDeserializer) deserializer, fields, db, beanDesc
- .getType().getRawClass(), objectMapper);
+ .getType().getRawClass());
}
}
return super.modifyDeserializer(config, beanDesc, deserializer);
@@ -58,7 +58,7 @@ public void setUp() throws Exception {
@SuppressWarnings("unchecked")
private void setupHandlerAndProxy(DocumentReferences cascadeNone) {
try {
- collectionHandler = new ViewBasedCollection("test", db, TestType.class, cascadeNone, cac, mapper);
+ collectionHandler = new ViewBasedCollection("test", db, TestType.class, cascadeNone, cac);
} catch (Exception e) {
throw Exceptions.propagate(e);
}

0 comments on commit 4275fe9

Please sign in to comment.