Skip to content

Commit 3d7262a

Browse files
committed
Merge branch '1.2.x'
2 parents 04632c2 + 440997c commit 3d7262a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldPathPayloadSubsectionExtractor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2016 the original author or authors.
2+
* Copyright 2014-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,8 @@
3636
public class FieldPathPayloadSubsectionExtractor
3737
implements PayloadSubsectionExtractor<FieldPathPayloadSubsectionExtractor> {
3838

39+
private static final ObjectMapper objectMapper = new ObjectMapper();
40+
3941
private final String fieldPath;
4042

4143
private final String subsectionId;
@@ -66,7 +68,6 @@ protected FieldPathPayloadSubsectionExtractor(String fieldPath, String subsectio
6668

6769
@Override
6870
public byte[] extractSubsection(byte[] payload, MediaType contentType) {
69-
ObjectMapper objectMapper = new ObjectMapper();
7071
try {
7172
ExtractedField extractedField = new JsonFieldProcessor().extract(
7273
this.fieldPath, objectMapper.readValue(payload, Object.class));

0 commit comments

Comments
 (0)