Skip to content

Commit

Permalink
make Checkstyle happy
Browse files Browse the repository at this point in the history
  • Loading branch information
inponomarev committed Oct 27, 2024
1 parent a7daeee commit c19ad89
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
}
Expand Down

0 comments on commit c19ad89

Please sign in to comment.