Skip to content

Commit

Permalink
Have GlideString log byte array hash
Browse files Browse the repository at this point in the history
  • Loading branch information
jduo committed Jul 3, 2024
1 parent 0d0066d commit 09b5e49
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions java/client/src/main/java/glide/api/models/GlideString.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ public String getString() {
return string;
}

assert canConvertToString() : "Value cannot be represented as a string";
return string;
if (canConvertToString()) {
return string;
}
return String.format("Value not convertible to string: byte[] %d", Arrays.hashCode(bytes));
}

public int compareTo(GlideString o) {
Expand Down

0 comments on commit 09b5e49

Please sign in to comment.