From c19ad8960a19e7c457b0b8984c09739a7aaa4a7a Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 27 Oct 2024 11:17:25 +0300 Subject: [PATCH] make Checkstyle happy --- .../github/fppt/jedismock/operations/strings/SetRange.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/fppt/jedismock/operations/strings/SetRange.java b/src/main/java/com/github/fppt/jedismock/operations/strings/SetRange.java index 5822abcb..10fbbb77 100644 --- a/src/main/java/com/github/fppt/jedismock/operations/strings/SetRange.java +++ b/src/main/java/com/github/fppt/jedismock/operations/strings/SetRange.java @@ -25,13 +25,14 @@ protected Slice response() { if (offset < 0) { return Response.error("ERR offset is out of range"); } - Slice value = params().get(2); + Slice value = params().get(2); String oldValue = Optional.ofNullable(base().getRMString(key)) .map(RMString::getStoredDataAsString) .orElse(""); String padding = ""; - if (offset + value.length() > base().getProtoMaxBulkLen()) + if (offset + value.length() > base().getProtoMaxBulkLen()) { return Response.error("ERR string exceeds maximum allowed size (proto-max-bulk-len)"); + } if (offset > oldValue.length()) { padding = new String(new byte[offset - oldValue.length()]); }