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


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:
##########
@@ -982,7 +982,7 @@ private static Map<String, Object> 
connectorClientConfigOverrides(String connNam
         );
         List<ConfigValue> configValues = 
connectorClientConfigOverridePolicy.validate(connectorClientConfigRequest);
         List<ConfigValue> errorConfigs = configValues.stream().
-            filter(configValue -> configValue.errorMessages().size() > 
0).collect(Collectors.toList());
+            filter(configValue -> configValue.errorMessages().size() > 
0).toList();
         // These should be caught when the herder validates the connector 
configuration, but just in case
         if (errorConfigs.size() > 0) {

Review Comment:
   `configValue.errorMessages().size() > 0` can be replaced with 
`!configValue.errorMessages().isEmpty()`



##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ConnectorConfig.java:
##########
@@ -382,7 +382,6 @@ public <R extends ConnectRecord<R>> 
List<TransformationStage<R>> transformationS
                     String predicatePrefix = PREDICATES_PREFIX + 
predicateAlias + ".";
                     final String predicateTypeConfig = predicatePrefix + 
"type";
                     final String predicateVersionConfig = predicatePrefix + 
WorkerConfig.PLUGIN_VERSION_SUFFIX;
-                    @SuppressWarnings("unchecked")
                     Predicate<R> predicate = 
getTransformationOrPredicate(plugins, predicateTypeConfig, 
predicateVersionConfig);
                     predicate.configure(originalsWithPrefix(predicatePrefix));
                     Plugin<Predicate<R>> predicatePlugin = 
metrics.wrap(predicate, connectorTaskId, (String) predicateAlias);

Review Comment:
   It seems the generics T never used in `converterDefaults` and 
`fetchPluginVersion`, we can remove it. 



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