Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -255,7 +255,7 @@ else if (ch == '"') {
nextIndex++;
}
String parameter = mimeType.substring(index + 1, nextIndex).trim();
if (parameter.length() > 0) {
if (!parameter.isEmpty()) {
if (parameters == null) {
parameters = new LinkedHashMap<>(4);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,8 @@ public static String nullSafeConciseToString(@Nullable Object obj) {
return NULL_STRING;
}
if (obj instanceof Optional<?> optional) {
return (optional.isEmpty() ? "Optional.empty" :
"Optional[%s]".formatted(nullSafeConciseToString(optional.get())));
return optional.map(o -> "Optional[%s]".formatted(nullSafeConciseToString(o)))
.orElse("Optional.empty");
}
if (obj.getClass().isArray()) {
return (Array.getLength(obj) == 0 ? EMPTY_ARRAY : NON_EMPTY_ARRAY);
Expand Down