From 029f399a141de676ae62744280dacff2c36a8d98 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Wed, 10 Jun 2020 08:58:40 +0200 Subject: [PATCH] Rename ViaCodecException to CancelCodecException --- .../myles/ViaVersion/bukkit/handlers/BukkitDecodeHandler.java | 4 ++-- .../myles/ViaVersion/bukkit/handlers/BukkitEncodeHandler.java | 4 ++-- .../myles/ViaVersion/bungee/handlers/BungeeDecodeHandler.java | 4 ++-- .../myles/ViaVersion/bungee/handlers/BungeeEncodeHandler.java | 4 ++-- .../{ViaCodecException.java => CancelCodecException.java} | 2 +- .../us/myles/ViaVersion/exception/CancelDecoderException.java | 2 +- .../us/myles/ViaVersion/exception/CancelEncoderException.java | 2 +- .../myles/ViaVersion/sponge/handlers/SpongeDecodeHandler.java | 4 ++-- .../myles/ViaVersion/sponge/handlers/SpongeEncodeHandler.java | 4 ++-- .../ViaVersion/velocity/handlers/VelocityDecodeHandler.java | 4 ++-- .../ViaVersion/velocity/handlers/VelocityEncodeHandler.java | 4 ++-- 11 files changed, 19 insertions(+), 19 deletions(-) rename common/src/main/java/us/myles/ViaVersion/exception/{ViaCodecException.java => CancelCodecException.java} (84%) diff --git a/bukkit/src/main/java/us/myles/ViaVersion/bukkit/handlers/BukkitDecodeHandler.java b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/handlers/BukkitDecodeHandler.java index 700f3e79d..87adc5c22 100644 --- a/bukkit/src/main/java/us/myles/ViaVersion/bukkit/handlers/BukkitDecodeHandler.java +++ b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/handlers/BukkitDecodeHandler.java @@ -6,7 +6,7 @@ import io.netty.handler.codec.ByteToMessageDecoder; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.bukkit.util.NMSUtil; import us.myles.ViaVersion.exception.CancelDecoderException; -import us.myles.ViaVersion.exception.ViaCodecException; +import us.myles.ViaVersion.exception.CancelCodecException; import us.myles.ViaVersion.util.PipelineUtil; import java.lang.reflect.InvocationTargetException; @@ -53,7 +53,7 @@ public class BukkitDecodeHandler extends ByteToMessageDecoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (PipelineUtil.containsCause(cause, ViaCodecException.class)) return; // ProtocolLib compat + if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return; // ProtocolLib compat super.exceptionCaught(ctx, cause); if (!NMSUtil.isDebugPropertySet()) { diff --git a/bukkit/src/main/java/us/myles/ViaVersion/bukkit/handlers/BukkitEncodeHandler.java b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/handlers/BukkitEncodeHandler.java index 13099db01..05b4e6fb8 100644 --- a/bukkit/src/main/java/us/myles/ViaVersion/bukkit/handlers/BukkitEncodeHandler.java +++ b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/handlers/BukkitEncodeHandler.java @@ -6,7 +6,7 @@ import io.netty.handler.codec.MessageToByteEncoder; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.bukkit.util.NMSUtil; import us.myles.ViaVersion.exception.CancelEncoderException; -import us.myles.ViaVersion.exception.ViaCodecException; +import us.myles.ViaVersion.exception.CancelCodecException; import us.myles.ViaVersion.handlers.ChannelHandlerContextWrapper; import us.myles.ViaVersion.handlers.ViaHandler; import us.myles.ViaVersion.util.PipelineUtil; @@ -65,7 +65,7 @@ public class BukkitEncodeHandler extends MessageToByteEncoder implements ViaHand @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (PipelineUtil.containsCause(cause, ViaCodecException.class)) return; // ProtocolLib compat + if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return; // ProtocolLib compat super.exceptionCaught(ctx, cause); if (!NMSUtil.isDebugPropertySet()) { diff --git a/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeDecodeHandler.java b/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeDecodeHandler.java index 24b8f00b2..920af4ad4 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeDecodeHandler.java +++ b/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeDecodeHandler.java @@ -6,7 +6,7 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToMessageDecoder; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.exception.CancelDecoderException; -import us.myles.ViaVersion.exception.ViaCodecException; +import us.myles.ViaVersion.exception.CancelCodecException; import java.util.List; @@ -37,7 +37,7 @@ public class BungeeDecodeHandler extends MessageToMessageDecoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (cause instanceof ViaCodecException) return; + if (cause instanceof CancelCodecException) return; super.exceptionCaught(ctx, cause); } } diff --git a/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeEncodeHandler.java b/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeEncodeHandler.java index 1ad87bcd6..914ce20e3 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeEncodeHandler.java +++ b/bungee/src/main/java/us/myles/ViaVersion/bungee/handlers/BungeeEncodeHandler.java @@ -7,7 +7,7 @@ import io.netty.handler.codec.MessageToMessageEncoder; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.bungee.util.BungeePipelineUtil; import us.myles.ViaVersion.exception.CancelEncoderException; -import us.myles.ViaVersion.exception.ViaCodecException; +import us.myles.ViaVersion.exception.CancelCodecException; import java.util.List; @@ -78,7 +78,7 @@ public class BungeeEncodeHandler extends MessageToMessageEncoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (cause instanceof ViaCodecException) return; + if (cause instanceof CancelCodecException) return; super.exceptionCaught(ctx, cause); } } diff --git a/common/src/main/java/us/myles/ViaVersion/exception/ViaCodecException.java b/common/src/main/java/us/myles/ViaVersion/exception/CancelCodecException.java similarity index 84% rename from common/src/main/java/us/myles/ViaVersion/exception/ViaCodecException.java rename to common/src/main/java/us/myles/ViaVersion/exception/CancelCodecException.java index 13e6b6543..a3514a7e2 100644 --- a/common/src/main/java/us/myles/ViaVersion/exception/ViaCodecException.java +++ b/common/src/main/java/us/myles/ViaVersion/exception/CancelCodecException.java @@ -6,5 +6,5 @@ package us.myles.ViaVersion.exception; * @see CancelEncoderException * @see CancelDecoderException */ -public interface ViaCodecException { +public interface CancelCodecException { } diff --git a/common/src/main/java/us/myles/ViaVersion/exception/CancelDecoderException.java b/common/src/main/java/us/myles/ViaVersion/exception/CancelDecoderException.java index c35e46199..79eecac47 100644 --- a/common/src/main/java/us/myles/ViaVersion/exception/CancelDecoderException.java +++ b/common/src/main/java/us/myles/ViaVersion/exception/CancelDecoderException.java @@ -7,7 +7,7 @@ import us.myles.ViaVersion.api.Via; * Thrown during packet decoding when an incoming packet should be cancelled. * Specifically extends {@link DecoderException} to prevent netty from wrapping the exception. */ -public class CancelDecoderException extends DecoderException implements ViaCodecException { +public class CancelDecoderException extends DecoderException implements CancelCodecException { public static final CancelDecoderException CACHED = new CancelDecoderException("This packet is supposed to be cancelled; If you have debug enabled, you can ignore these") { @Override public Throwable fillInStackTrace() { diff --git a/common/src/main/java/us/myles/ViaVersion/exception/CancelEncoderException.java b/common/src/main/java/us/myles/ViaVersion/exception/CancelEncoderException.java index 047eb1e76..b462af81f 100644 --- a/common/src/main/java/us/myles/ViaVersion/exception/CancelEncoderException.java +++ b/common/src/main/java/us/myles/ViaVersion/exception/CancelEncoderException.java @@ -7,7 +7,7 @@ import us.myles.ViaVersion.api.Via; * Thrown during packet encoding when an outgoing packet should be cancelled. * Specifically extends {@link EncoderException} to prevent netty from wrapping the exception. */ -public class CancelEncoderException extends EncoderException implements ViaCodecException { +public class CancelEncoderException extends EncoderException implements CancelCodecException { public static final CancelEncoderException CACHED = new CancelEncoderException("This packet is supposed to be cancelled; If you have debug enabled, you can ignore these") { @Override public Throwable fillInStackTrace() { diff --git a/sponge/src/main/java/us/myles/ViaVersion/sponge/handlers/SpongeDecodeHandler.java b/sponge/src/main/java/us/myles/ViaVersion/sponge/handlers/SpongeDecodeHandler.java index 88747ff4c..975a62896 100644 --- a/sponge/src/main/java/us/myles/ViaVersion/sponge/handlers/SpongeDecodeHandler.java +++ b/sponge/src/main/java/us/myles/ViaVersion/sponge/handlers/SpongeDecodeHandler.java @@ -5,7 +5,7 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.exception.CancelDecoderException; -import us.myles.ViaVersion.exception.ViaCodecException; +import us.myles.ViaVersion.exception.CancelCodecException; import us.myles.ViaVersion.util.PipelineUtil; import java.lang.reflect.InvocationTargetException; @@ -53,7 +53,7 @@ public class SpongeDecodeHandler extends ByteToMessageDecoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (cause instanceof ViaCodecException) return; + if (cause instanceof CancelCodecException) return; super.exceptionCaught(ctx, cause); } } diff --git a/sponge/src/main/java/us/myles/ViaVersion/sponge/handlers/SpongeEncodeHandler.java b/sponge/src/main/java/us/myles/ViaVersion/sponge/handlers/SpongeEncodeHandler.java index eb6a9e9a6..cb6d90fae 100644 --- a/sponge/src/main/java/us/myles/ViaVersion/sponge/handlers/SpongeEncodeHandler.java +++ b/sponge/src/main/java/us/myles/ViaVersion/sponge/handlers/SpongeEncodeHandler.java @@ -5,7 +5,7 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToByteEncoder; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.exception.CancelEncoderException; -import us.myles.ViaVersion.exception.ViaCodecException; +import us.myles.ViaVersion.exception.CancelCodecException; import us.myles.ViaVersion.handlers.ChannelHandlerContextWrapper; import us.myles.ViaVersion.handlers.ViaHandler; import us.myles.ViaVersion.util.PipelineUtil; @@ -49,7 +49,7 @@ public class SpongeEncodeHandler extends MessageToByteEncoder implements @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (cause instanceof ViaCodecException) return; + if (cause instanceof CancelCodecException) return; super.exceptionCaught(ctx, cause); } } diff --git a/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java b/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java index 1c55e6b2b..7c140f56c 100644 --- a/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java +++ b/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java @@ -6,7 +6,7 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToMessageDecoder; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.exception.CancelDecoderException; -import us.myles.ViaVersion.exception.ViaCodecException; +import us.myles.ViaVersion.exception.CancelCodecException; import java.util.List; @@ -37,7 +37,7 @@ public class VelocityDecodeHandler extends MessageToMessageDecoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (cause instanceof ViaCodecException) return; + if (cause instanceof CancelCodecException) return; super.exceptionCaught(ctx, cause); } } diff --git a/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityEncodeHandler.java b/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityEncodeHandler.java index c0091228c..3edb7a1e9 100644 --- a/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityEncodeHandler.java +++ b/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityEncodeHandler.java @@ -8,7 +8,7 @@ import io.netty.handler.codec.MessageToMessageDecoder; import io.netty.handler.codec.MessageToMessageEncoder; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.exception.CancelEncoderException; -import us.myles.ViaVersion.exception.ViaCodecException; +import us.myles.ViaVersion.exception.CancelCodecException; import us.myles.ViaVersion.util.PipelineUtil; import java.lang.reflect.InvocationTargetException; @@ -81,7 +81,7 @@ public class VelocityEncodeHandler extends MessageToMessageEncoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (cause instanceof ViaCodecException) return; + if (cause instanceof CancelCodecException) return; super.exceptionCaught(ctx, cause); } }