Skip to content

Commit

Permalink
tiny refactoring to reproduce duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Nov 21, 2013
1 parent 68f2a77 commit df554c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import com.fasterxml.jackson.databind.util.ClassUtil;
import com.fasterxml.jackson.databind.util.Converter;

/**
Expand Down Expand Up @@ -75,11 +76,11 @@ public Class<?> handledType() {
* {@link JacksonStdImpl} annotation on deserializer class.
*/
protected boolean isDefaultDeserializer(JsonDeserializer<?> deserializer) {
return (deserializer != null && deserializer.getClass().getAnnotation(JacksonStdImpl.class) != null);
return ClassUtil.isJacksonStdImpl(deserializer);
}

protected boolean isDefaultKeyDeserializer(KeyDeserializer keyDeser) {
return (keyDeser != null && keyDeser.getClass().getAnnotation(JacksonStdImpl.class) != null);
return ClassUtil.isJacksonStdImpl(keyDeser);
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.ser.FilterProvider;
import com.fasterxml.jackson.databind.ser.PropertyFilter;
import com.fasterxml.jackson.databind.util.ClassUtil;
import com.fasterxml.jackson.databind.util.Converter;

/**
Expand Down Expand Up @@ -225,7 +226,7 @@ public void wrapAndThrow(SerializerProvider provider,
* {@link JacksonStdImpl} annotation on serializer class.
*/
protected boolean isDefaultSerializer(JsonSerializer<?> serializer) {
return (serializer != null && serializer.getClass().getAnnotation(JacksonStdImpl.class) != null);
return ClassUtil.isJacksonStdImpl(serializer);
}

/**
Expand Down

0 comments on commit df554c6

Please sign in to comment.