ijuma commented on code in PR #18371: URL: https://github.com/apache/kafka/pull/18371#discussion_r1904765774
########## connect/api/src/main/java/org/apache/kafka/connect/data/Values.java: ########## @@ -431,33 +431,20 @@ protected static Object convertTo(Schema toSchema, Schema fromSchema, Object val } throw new DataException("Unable to convert a null value to a schema that requires a value"); } - switch (toSchema.type()) { - case BYTES: - return convertMaybeLogicalBytes(toSchema, value); - case STRING: - return convertToString(fromSchema, value); - case BOOLEAN: - return convertToBoolean(fromSchema, value); - case INT8: - return convertToByte(fromSchema, value); - case INT16: - return convertToShort(fromSchema, value); - case INT32: - return convertMaybeLogicalInteger(toSchema, fromSchema, value); - case INT64: - return convertMaybeLogicalLong(toSchema, fromSchema, value); - case FLOAT32: - return convertToFloat(fromSchema, value); - case FLOAT64: - return convertToDouble(fromSchema, value); - case ARRAY: - return convertToArray(toSchema, value); - case MAP: - return convertToMapInternal(toSchema, value); - case STRUCT: - return convertToStructInternal(toSchema, value); - } - throw new DataException("Unable to convert " + value + " (" + value.getClass() + ") to " + toSchema); Review Comment: This case is never hit since the switch is exhaustive. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org