From 4043f67610cbc3bb5fb491defc1bf3454308acfe Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Sat, 15 Nov 2014 14:26:00 -0500 Subject: [PATCH] Remove unused variable --- .../integration/protocol/TestPingPacket.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/ProtocolLib/src/test/java/com/comphenix/integration/protocol/TestPingPacket.java b/ProtocolLib/src/test/java/com/comphenix/integration/protocol/TestPingPacket.java index 8b9e934a..a0170b7e 100644 --- a/ProtocolLib/src/test/java/com/comphenix/integration/protocol/TestPingPacket.java +++ b/ProtocolLib/src/test/java/com/comphenix/integration/protocol/TestPingPacket.java @@ -11,8 +11,6 @@ import java.util.concurrent.TimeUnit; import org.bukkit.plugin.Plugin; import com.comphenix.protocol.PacketType; -import com.comphenix.protocol.PacketType.Protocol; -import com.comphenix.protocol.PacketType.Sender; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketEvent; @@ -20,16 +18,16 @@ import com.comphenix.protocol.events.PacketEvent; public class TestPingPacket { // Current versions private static final int PROTOCOL_VERSION = 4; - + // Timeout private static final int TIMEOUT_PING_MS = 10000; - + private volatile String source; - + private TestPingPacket() { // Prevent external constructors } - + /** * Create a new test ping packet test. * @return The new test. @@ -37,7 +35,7 @@ public class TestPingPacket { public static TestPingPacket newTest() { return new TestPingPacket(); } - + /** * Invoked when the test should be started. * @param plugin - the current plugin. @@ -47,7 +45,7 @@ public class TestPingPacket { try { String transmitted = testInterception(plugin). get(TIMEOUT_PING_MS, TimeUnit.MILLISECONDS); - + // Make sure it's the same System.out.println("Server string: " + transmitted); assertEquals(source, transmitted); @@ -55,10 +53,8 @@ public class TestPingPacket { throw e.getCause(); } } - + private Future testInterception(Plugin test) { - PacketType customPacket = PacketType.fromCurrent(Protocol.STATUS, Sender.CLIENT, 3, -1); - ProtocolLibrary.getProtocolManager().addPacketListener( new PacketAdapter(test, PacketType.Status.Server.OUT_SERVER_INFO) { @Override @@ -66,7 +62,7 @@ public class TestPingPacket { source = event.getPacket().getServerPings().read(0).toJson(); } }); - + // Invoke the client on a separate thread return Executors.newSingleThreadExecutor().submit(new Callable() { @Override @@ -75,7 +71,7 @@ public class TestPingPacket { String information = client.queryLocalPing(); // Wait for the listener to catch up - for (int i = 0; i < 1000 && (source == null); i++) + for (int i = 0; i < 1000 && (source == null); i++) Thread.sleep(1); return information;