diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java index de02cc4e3f4..0869f3dae85 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java @@ -179,6 +179,7 @@ public abstract class Utf8Appendable return _state == UTF8_ACCEPT; } + @SuppressWarnings("serial") public static class NotUtf8Exception extends IllegalArgumentException { public NotUtf8Exception(String reason) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuilder.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuilder.java index 09866884eae..b42f1d5f7ed 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuilder.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuilder.java @@ -72,6 +72,6 @@ public class Utf8StringBuilder extends Utf8Appendable private void checkState() { if (!isUtf8SequenceComplete()) - throw new IllegalArgumentException("Tried to read incomplete UTF8 decoded String"); + throw new NotUtf8Exception("Tried to read incomplete UTF8 decoded String"); } }