chia7712 commented on code in PR #19452:
URL: https://github.com/apache/kafka/pull/19452#discussion_r2041532201


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractHerder.java:
##########
@@ -1082,12 +1081,8 @@ protected final boolean maybeAddConfigErrors(
 
     private String trace(Throwable t) {
         ByteArrayOutputStream output = new ByteArrayOutputStream();
-        try {
-            t.printStackTrace(new PrintStream(output, false, 
StandardCharsets.UTF_8.name()));
-            return output.toString(StandardCharsets.UTF_8.name());
-        } catch (UnsupportedEncodingException e) {
-            return null;
-        }
+        t.printStackTrace(new PrintStream(output, false, 
StandardCharsets.UTF_8));
+        return output.toString(StandardCharsets.UTF_8);

Review Comment:
   nice cleanup. open https://issues.apache.org/jira/browse/KAFKA-19137 to 
cleanup remaining usages.



##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/SubmittedRecords.java:
##########
@@ -261,6 +259,7 @@ static class CommittableOffsets {
         /**
          * @return the offsets that can be committed at the time of the 
snapshot
          */
+        @Override
         public Map<Map<String, Object>, Map<String, Object>> offsets() {
             return Collections.unmodifiableMap(offsets);

Review Comment:
   we can remove `Collections.unmodifiableMap` by using `Map.copyOf` to copy 
`offsets` in the constructor



-- 
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

Reply via email to