From 0856a0b3f2cfcb74a2e9b4b15da1a17bc7012dd3 Mon Sep 17 00:00:00 2001 From: Andrew Fiddian-Green Date: Thu, 12 Nov 2020 03:49:27 +0000 Subject: [PATCH] [hdpowerview] deferred instantiation of JAX-RS client (#9002) Signed-off-by: Andrew Fiddian-Green --- .../hdpowerview/internal/handler/HDPowerViewHubHandler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewHubHandler.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewHubHandler.java index fe92d1812..f7777d7ac 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewHubHandler.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewHubHandler.java @@ -21,7 +21,6 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import javax.ws.rs.ProcessingException; -import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import org.eclipse.jdt.annotation.NonNullByDefault; @@ -68,7 +67,6 @@ public class HDPowerViewHubHandler extends BaseBridgeHandler { private long refreshInterval; private long hardRefreshInterval; - private final Client client = ClientBuilder.newClient(); private @Nullable HDPowerViewWebTargets webTargets; private @Nullable ScheduledFuture pollFuture; private @Nullable ScheduledFuture hardRefreshFuture; @@ -116,7 +114,7 @@ public class HDPowerViewHubHandler extends BaseBridgeHandler { return; } - webTargets = new HDPowerViewWebTargets(client, host); + webTargets = new HDPowerViewWebTargets(ClientBuilder.newClient(), host); refreshInterval = config.refresh; hardRefreshInterval = config.hardRefresh; schedulePoll();