From d2410c0a3da59dfa11f03a74bc01f252db4894a5 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 28 Nov 2019 13:45:04 +0100 Subject: [PATCH] Do not reconfigure ObjectMapper in FutureTransformUtils This is a shared ObjectMapper, which will be reconfigured on first access -- we can do that upfront and save some cycles from the fast path. Change-Id: Ibdf27ff194350b96ee6aadeaa9725d4cfdc6e9db Signed-off-by: Robert Varga --- .../opendaylight/ovsdb/lib/impl/FutureTransformUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/impl/FutureTransformUtils.java b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/impl/FutureTransformUtils.java index 7ba31f0b0..984436453 100644 --- a/library/impl/src/main/java/org/opendaylight/ovsdb/lib/impl/FutureTransformUtils.java +++ b/library/impl/src/main/java/org/opendaylight/ovsdb/lib/impl/FutureTransformUtils.java @@ -20,14 +20,14 @@ import org.opendaylight.ovsdb.lib.operations.Operation; import org.opendaylight.ovsdb.lib.operations.OperationResult; public final class FutureTransformUtils { - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); private FutureTransformUtils() { } public static ListenableFuture> transformTransactResponse( - ListenableFuture> transactResponseFuture, final List operations) { - OBJECT_MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + final ListenableFuture> transactResponseFuture, final List operations) { return Futures.transform(transactResponseFuture, jsonNodes -> { final List operationResults = new ArrayList<>(); for (int index = 0; index < jsonNodes.size(); index++) { -- 2.36.6