File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
api/src/main/java/com/viaversion/viaversion/api/type/types Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,21 +49,21 @@ public String read(ByteBuf buffer) {
4949 int len = Types .VAR_INT .readPrimitive (buffer );
5050
5151 Preconditions .checkArgument (len <= maxLength * MAX_CHAR_UTF_8_LENGTH ,
52- "Cannot receive string longer than Short.MAX_VALUE * " + MAX_CHAR_UTF_8_LENGTH + " bytes (got %s bytes)" , len );
52+ "Cannot receive string longer than " + maxLength + " * " + MAX_CHAR_UTF_8_LENGTH + " bytes (got %s bytes)" , len );
5353
5454 String string = buffer .toString (buffer .readerIndex (), len , StandardCharsets .UTF_8 );
5555 buffer .skipBytes (len );
5656
5757 Preconditions .checkArgument (string .length () <= maxLength ,
58- "Cannot receive string longer than Short.MAX_VALUE characters (got %s bytes)" , string .length ());
58+ "Cannot receive string longer than " + maxLength + " characters (got %s bytes)" , string .length ());
5959
6060 return string ;
6161 }
6262
6363 @ Override
6464 public void write (ByteBuf buffer , String object ) {
6565 if (object .length () > maxLength ) {
66- throw new IllegalArgumentException ("Cannot send string longer than Short.MAX_VALUE characters (got " + object .length () + " characters)" );
66+ throw new IllegalArgumentException ("Cannot send string longer than " + maxLength + " characters (got " + object .length () + " characters)" );
6767 }
6868
6969 byte [] b = object .getBytes (StandardCharsets .UTF_8 );
You can’t perform that action at this time.
0 commit comments