[ 
https://issues.apache.org/jira/browse/CAMEL-28019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153845#comment-18153845
 ] 

Guillaume Nodet commented on CAMEL-28019:
-----------------------------------------

This issue is being investigated by a coding agent (on behalf of gnodet).

Confirmed: StitchConstants.java declares javaType = "Collection<String>" for 
the CamelStitchKeyNames header, but StitchProducerOperations.java reads it as 
String.class and splits on commas. A user setting the header as 
Collection<String> gets broken key names like "[a" and " b]" because toString() 
on a List produces "[a, b]".

Fix will accept both Collection<String> and comma-separated String in 
getKeyNames(), and add a unit test for the Collection header path.

_Note: This comment was generated by an AI coding agent and requires manual 
verification._

> camel-stitch - the CamelStitchKeyNames header is declared as 
> Collection<String> but read as a String
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-28019
>                 URL: https://issues.apache.org/jira/browse/CAMEL-28019
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Claus Ibsen
>            Assignee: Guillaume Nodet
>            Priority: Minor
>             Fix For: 4.25.0
>
>
> StitchConstants.KEY_NAMES declares javaType Collection<String>, but 
> StitchProducerOperations.getKeyNames reads the header as a String 
> (getOption(message, StitchConstants.KEY_NAMES, configuration::getKeyNames, 
> String.class)) and splits it on commas. A Collection set as the header, as 
> the catalog suggests, is converted with toString() to "[a, b]", which gives 
> the key names "[a" and " b]".
> Fix: accept a Collection as well as a comma separated String in getKeyNames 
> (or declare the header as String), and add a test for both.
> Found while declaring the message headers of the components (CAMEL-27980).
> ----
> _Filed by Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to