From bb4e8e29a53ba5ea74552a94fa04d164dbb15cd2 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 27 May 2013 18:22:59 +1000 Subject: [PATCH] Update Netty version and remove our workaround - if this breaks, @mibby keeps the pieces. --- pom.xml | 2 +- .../net/md_5/bungee/netty/ChannelWrapper.java | 4 +- .../bungee/netty/ReusableChannelPromise.java | 179 ------------------ 3 files changed, 2 insertions(+), 183 deletions(-) delete mode 100644 proxy/src/main/java/net/md_5/bungee/netty/ReusableChannelPromise.java diff --git a/pom.xml b/pom.xml index 0d8dfef1..83e21794 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ unknown - 4.0.0.CR3 + 4.0.0.Final-SNAPSHOT UTF-8 diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java index 7867165e..983dcf7f 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -9,19 +9,17 @@ public class ChannelWrapper private final Channel ch; @Getter private volatile boolean closed; - private final ReusableChannelPromise promise; public ChannelWrapper(Channel ch) { this.ch = ch; - this.promise = new ReusableChannelPromise( ch ); } public synchronized void write(Object packet) { if ( !closed ) { - ch.write( packet, promise ); + ch.write( packet, ch.voidPromise() ); } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ReusableChannelPromise.java b/proxy/src/main/java/net/md_5/bungee/netty/ReusableChannelPromise.java deleted file mode 100644 index f420909a..00000000 --- a/proxy/src/main/java/net/md_5/bungee/netty/ReusableChannelPromise.java +++ /dev/null @@ -1,179 +0,0 @@ -package net.md_5.bungee.netty; - -import io.netty.channel.Channel; -import io.netty.channel.ChannelPromise; -import io.netty.util.concurrent.Future; -import io.netty.util.concurrent.GenericFutureListener; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -public class ReusableChannelPromise implements ChannelPromise -{ - - private final Channel ch; - - @Override - public Channel channel() - { - return ch; - } - - @Override - public ChannelPromise setSuccess(Void result) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise setSuccess() - { - return this; - } - - @Override - public boolean trySuccess() - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise setFailure(Throwable cause) - { - return this; - } - - @Override - public ChannelPromise addListener(GenericFutureListener> listener) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise addListeners(GenericFutureListener>... listeners) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise removeListener(GenericFutureListener> listener) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise removeListeners(GenericFutureListener>... listeners) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise sync() throws InterruptedException - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise syncUninterruptibly() - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise await() throws InterruptedException - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public ChannelPromise awaitUninterruptibly() - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean isSuccess() - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public Throwable cause() - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean await(long timeout, TimeUnit unit) throws InterruptedException - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean await(long timeoutMillis) throws InterruptedException - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean awaitUninterruptibly(long timeout, TimeUnit unit) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean awaitUninterruptibly(long timeoutMillis) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public Void getNow() - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean cancel(boolean mayInterruptIfRunning) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean isCancelled() - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean isDone() - { - return false; - } - - @Override - public Void get() throws InterruptedException, ExecutionException - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean trySuccess(Void result) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } - - @Override - public boolean tryFailure(Throwable cause) - { - throw new UnsupportedOperationException( "Not supported yet." ); - } -}