From 253654bb636b35c05ad7a5ca33dfb3d5d7dda969 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 6 Jul 2015 06:53:01 +0200 Subject: [PATCH] Refactoring --- .../net/pterodactylus/fcp/quelaton/ClientGetCommandImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/ClientGetCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/ClientGetCommandImpl.java index b08ff4e..b4e391a 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/ClientGetCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/ClientGetCommandImpl.java @@ -81,6 +81,11 @@ class ClientGetCommandImpl implements ClientGetCommand { @Override public Future> uri(String uri) { + ClientGet clientGet = createClientGetCommand(uri); + return threadPool.submit(() -> new ClientGetReplySequence().send(clientGet).get()); + } + + private ClientGet createClientGetCommand(String uri) { ClientGet clientGet = new ClientGet(uri, identifier, ReturnType.direct); if (ignoreDataStore) { clientGet.setIgnoreDataStore(true); @@ -100,11 +105,7 @@ class ClientGetCommandImpl implements ClientGetCommand { if (global) { clientGet.setGlobal(true); } - return threadPool.submit(() -> { - FcpReplySequence> replySequence = - new ClientGetReplySequence(); - return replySequence.send(clientGet).get(); - }); + return clientGet; } private class ClientGetReplySequence extends FcpReplySequence> { -- 2.7.4