diff --git a/src/main/java/com/commafeed/frontend/rest/JSONMessageBodyReaderWriter.java b/src/main/java/com/commafeed/frontend/rest/JSONMessageBodyReaderWriter.java index 502f0b3c..64619a16 100644 --- a/src/main/java/com/commafeed/frontend/rest/JSONMessageBodyReaderWriter.java +++ b/src/main/java/com/commafeed/frontend/rest/JSONMessageBodyReaderWriter.java @@ -68,14 +68,7 @@ public class JSONMessageBodyReaderWriter implements MessageBodyWriter, httpHeaders.putSingle(HttpHeaders.CONTENT_TYPE, mediaType.toString() + ";charset=UTF-8"); OutputStreamWriter writer = new OutputStreamWriter(entityStream, UTF_8); - - Type jsonType; - if (type.equals(genericType)) { - jsonType = type; - } else { - jsonType = genericType; - } - getGson().toJson(t, jsonType, writer); + getGson().toJson(t, type, writer); writer.flush(); } @@ -86,13 +79,7 @@ public class JSONMessageBodyReaderWriter implements MessageBodyWriter, throws IOException, WebApplicationException { InputStreamReader reader = new InputStreamReader( new BufferedInputStream(entityStream), UTF_8); - Type jsonType; - if (type.equals(genericType)) { - jsonType = type; - } else { - jsonType = genericType; - } - return getGson().fromJson(reader, jsonType); + return getGson().fromJson(reader, type); } private Gson getGson() {