Skip to content

Commit 2769771

Browse files
authored
refactor(mapper): using objectmapper field (#114)
1 parent 5168ec9 commit 2769771

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

api/src/main/java/com/javadiscord/jdi/core/api/DiscordResponseParser.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ public <T> AsyncResponse<List<T>> callAndParseList(Class<T> clazz, DiscordReques
3535

3636
private <T> List<T> parseResponse(Class<T> elementType, String response)
3737
throws JsonProcessingException {
38-
ObjectMapper objectMapper = new ObjectMapper();
39-
return objectMapper.readValue(
38+
return OBJECT_MAPPER.readValue(
4039
response,
41-
objectMapper.getTypeFactory().constructCollectionType(List.class, elementType));
40+
OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, elementType));
4241
}
4342

4443
public <T> AsyncResponse<T> callAndParse(Class<T> clazz, DiscordRequest request) {

0 commit comments

Comments
 (0)