chia7712 commented on code in PR #24085:
URL: https://github.com/apache/kafka/pull/24085#discussion_r4669226119
##########
server-common/src/main/java/org/apache/kafka/server/util/Json.java:
##########
@@ -24,17 +24,16 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.MissingNode;
-import java.io.IOException;
import java.util.Optional;
/**
- * Provides methods for parsing JSON with Jackson and encoding to JSON with a
simple and naive custom implementation.
+ * Provides methods for parsing and encoding JSON with Jackson.
*/
public final class Json {
private static final ObjectMapper MAPPER = new ObjectMapper();
/**
- * Parse a JSON string into a JsonValue if possible. `Empty` is returned
if `input` is not valid JSON.
+ * Parse a JSON string into a JsonValue if possible. {@link
Optional#empty()} is returned if `input` is not valid JSON.
*/
public static Optional<JsonValue> parseFull(String input) {
Review Comment:
It seems all usages just throw an exception if the returned object is empty.
Could we switch them to tryParseFull and then remove parseFull?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]