From 2d20ecfaf31c653140e4135c42f8233e001dacb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 21 Mar 2018 07:48:25 +0100 Subject: [PATCH] Use a real RequestClient instead of casting the HLSC --- src/main/java/net/pterodactylus/sone/core/FreenetInterface.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java index 0fb34b5..f2cbec6 100644 --- a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java +++ b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java @@ -93,6 +93,7 @@ public class FreenetInterface { /** The high-level client to use for requests. */ private final HighLevelSimpleClient client; + private final RequestClient requestClient = new RequestClientBuilder().realTime().build(); /** The USK callbacks. */ private final Map soneUskCallbacks = new HashMap(); @@ -256,7 +257,7 @@ public class FreenetInterface { try { soneUskCallbacks.put(routingKey(requestUri), uskCallback); node.clientCore.uskManager.subscribe(create(requestUri), - uskCallback, true, (RequestClient) client); + uskCallback, true, requestClient); } catch (MalformedURLException mue1) { logger.log(WARNING, format("Could not subscribe USK “%s”!", requestUri), mue1); @@ -269,8 +270,7 @@ public class FreenetInterface { soneUskCallbacks.put(routingKey(requestUri), uskCallback); node.clientCore .uskManager - .subscribe(create(requestUri), uskCallback, false, - (RequestClient) client); + .subscribe(create(requestUri), uskCallback, false, requestClient); } catch (MalformedURLException mue1) { logger.log(WARNING, format("Could not subscribe USK “%s”!", requestUri), @@ -326,7 +326,7 @@ public class FreenetInterface { }; try { - node.clientCore.uskManager.subscribe(USK.create(uri), uskCallback, true, (RequestClient) client); + node.clientCore.uskManager.subscribe(USK.create(uri), uskCallback, true, requestClient); uriUskCallbacks.put(uri, uskCallback); } catch (MalformedURLException mue1) { logger.log(Level.WARNING, String.format("Could not subscribe to USK: %s", uri), mue1); -- 2.7.4