From: David ‘Bombe’ Roden Date: Mon, 6 Jul 2015 04:53:01 +0000 (+0200) Subject: Refactoring X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=253654bb636b35c05ad7a5ca33dfb3d5d7dda969;p=jFCPlib.git Refactoring --- 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> {