From cc2ce77c70df9210c41269deaf43f041768e0541 Mon Sep 17 00:00:00 2001 From: Fang Zheng Date: Tue, 9 Jan 2024 15:24:29 -0800 Subject: [PATCH] internal: Remove dead code in MessagePacker. (#787) --- .../src/main/java/org/msgpack/core/MessagePacker.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java b/msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java index 4cf789d9..72c26eca 100644 --- a/msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java +++ b/msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java @@ -774,10 +774,6 @@ else if (s.length() < (1 << 16)) { position += written; } else { - if (written >= (1L << 32)) { // this check does nothing because (1L << 32) is larger than Integer.MAX_VALUE - // this must not happen because s.length() is less than 2^16 and (2^16) * UTF_8_MAX_CHAR_SIZE is less than 2^32 - throw new IllegalArgumentException("Unexpected UTF-8 encoder state"); - } // move 2 bytes backward to expand 3-byte header region to 5 bytes buffer.putMessageBuffer(position + 5, buffer, position + 3, written); // write 3-byte header header