|
@@ -36,6 +36,7 @@ import java.util.Map;
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
@InterfaceAudience.Private
|
|
|
public class KMSJSONReader implements MessageBodyReader<Map> {
|
|
|
+ private static final ObjectMapper MAPPER = new ObjectMapper();
|
|
|
|
|
|
@Override
|
|
|
public boolean isReadable(Class<?> type, Type genericType,
|
|
@@ -48,7 +49,6 @@ public class KMSJSONReader implements MessageBodyReader<Map> {
|
|
|
Annotation[] annotations, MediaType mediaType,
|
|
|
MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
|
|
|
throws IOException, WebApplicationException {
|
|
|
- ObjectMapper mapper = new ObjectMapper();
|
|
|
- return mapper.readValue(entityStream, type);
|
|
|
+ return MAPPER.readValue(entityStream, type);
|
|
|
}
|
|
|
}
|