FrankYang0529 commented on code in PR #19464:
URL: https://github.com/apache/kafka/pull/19464#discussion_r2043706026


##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorMaker.java:
##########
@@ -236,14 +235,9 @@ private void checkHerder(SourceAndTarget sourceAndTarget) {
     private void addHerder(SourceAndTarget sourceAndTarget) {
         log.info("creating herder for " + sourceAndTarget.toString());
         Map<String, String> workerProps = config.workerConfig(sourceAndTarget);
-        List<String> restNamespace;
-        try {
-            String encodedSource = encodePath(sourceAndTarget.source());
-            String encodedTarget = encodePath(sourceAndTarget.target());
-            restNamespace = Arrays.asList(encodedSource, encodedTarget);
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException("Unable to create encoded URL paths for 
source and target using UTF-8", e);
-        }
+        String encodedSource = encodePath(sourceAndTarget.source());
+        String encodedTarget = encodePath(sourceAndTarget.target());
+        List<String> restNamespace = Arrays.asList(encodedSource, 
encodedTarget);

Review Comment:
   nit: Use `List.of`.



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