gnodet-bot commented on code in PR #31148:
URL: https://github.com/apache/camel/pull/31148#discussion_r4749780842


##########
components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Producer.java:
##########
@@ -134,10 +136,21 @@ private void translateText(TranslateClient 
translateClient, Exchange exchange) t
             }
             request.sourceLanguageCode(source);
             request.targetLanguageCode(target);
-            if 
(!ObjectHelper.isEmpty(exchange.getIn().getHeader(Translate2Constants.TERMINOLOGY_NAMES,
 Collection.class))) {
-                Collection<String> terminologies
-                        = 
exchange.getIn().getHeader(Translate2Constants.TERMINOLOGY_NAMES, 
Collection.class);
-                request.terminologyNames(terminologies);
+            Object terminologyNames = 
exchange.getIn().getHeader(Translate2Constants.TERMINOLOGY_NAMES);
+            if (terminologyNames != null) {
+                // one name or several names separated by commas, or a 
String[] or a Collection of names

Review Comment:
   The comment could be clearer that `String[]` takes the else-branch (type 
converter path), not the `instanceof String` path:
   
   ```suggestion
                   // String → split on commas; String[] or Collection → passed 
through Camel's type converter
   ```



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

Reply via email to