Skip to content

Commit

Permalink
convert byte array to string
Browse files Browse the repository at this point in the history
Signed-off-by: Sergei Malafeev <sergeymalafeev@gmail.com>
  • Loading branch information
malafeev committed May 2, 2019
1 parent 3a076d2 commit a8f9138
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ private static Map<String, Object> errorLogs(Throwable throwable) {
}

public static String nullable(Object object) {
return object == null ? "null" : object.toString();
if (object == null) {
return "";
}
if (object instanceof byte[]) {
// Spring Data in some cases converts string key/value to byte array
return Arrays.toString((byte[]) object);
}
return object.toString();
}

public static <V> String toString(Map<String, V> map) {
Expand Down

0 comments on commit a8f9138

Please sign in to comment.