From b8cf42cbbe5f71e5c1e2284e8ff10288abb68b16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 19 Mar 2009 22:56:20 +0100 Subject: [PATCH] Get rid of local variables. --- src/net/pterodactylus/fcp/highlevel/FcpClient.java | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/net/pterodactylus/fcp/highlevel/FcpClient.java index fdcdc39..a30218e 100644 --- a/src/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -145,7 +145,7 @@ public class FcpClient { * if an FCP error occurs */ public void connect() throws IOException, FcpException { - ExtendedFcpAdapter fcpListener = new ExtendedFcpAdapter() { + new ExtendedFcpAdapter() { /** * {@inheritDoc} @@ -165,8 +165,7 @@ public class FcpClient { public void receivedNodeHello(FcpConnection fcpConnection, NodeHello nodeHello) { completionLatch.countDown(); } - }; - fcpListener.execute(); + }.execute(); } /** @@ -198,7 +197,7 @@ public class FcpClient { */ public Set getPeers(final boolean withMetadata, final boolean withVolatile) throws IOException, FcpException { final Set peers = new HashSet(); - ExtendedFcpAdapter fcpListener = new ExtendedFcpAdapter() { + new ExtendedFcpAdapter() { /** * {@inheritDoc} @@ -224,8 +223,7 @@ public class FcpClient { public void receivedEndListPeers(FcpConnection fcpConnection, EndListPeers endListPeers) { completionLatch.countDown(); } - }; - fcpListener.execute(); + }.execute(); return peers; } @@ -301,7 +299,7 @@ public class FcpClient { * if an FCP error occurs */ private void addPeer(final AddPeer addPeer) throws IOException, FcpException { - ExtendedFcpAdapter fcpListener = new ExtendedFcpAdapter() { + new ExtendedFcpAdapter() { /** * {@inheritDoc} @@ -319,8 +317,7 @@ public class FcpClient { public void receivedPeer(FcpConnection fcpConnection, Peer peer) { completionLatch.countDown(); } - }; - fcpListener.execute(); + }.execute(); } /** @@ -345,7 +342,7 @@ public class FcpClient { * if an FCP error occurs */ public void modifyPeer(final Peer peer, final Boolean allowLocalAddresses, final Boolean disabled, final Boolean listenOnly) throws IOException, FcpException { - ExtendedFcpAdapter fcpListener = new ExtendedFcpAdapter() { + new ExtendedFcpAdapter() { /** * {@inheritDoc} @@ -363,8 +360,7 @@ public class FcpClient { public void receivedPeer(FcpConnection fcpConnection, Peer peer) { completionLatch.countDown(); } - }; - fcpListener.execute(); + }.execute(); } /** @@ -378,7 +374,7 @@ public class FcpClient { * if an FCP error occurs */ public void removePeer(final Peer peer) throws IOException, FcpException { - ExtendedFcpAdapter fcpListener = new ExtendedFcpAdapter() { + new ExtendedFcpAdapter() { /** * {@inheritDoc} @@ -396,8 +392,7 @@ public class FcpClient { public void receivedPeerRemoved(FcpConnection fcpConnection, PeerRemoved peerRemoved) { completionLatch.countDown(); } - }; - fcpListener.execute(); + }.execute(); } // -- 2.7.4