[ 
https://issues.apache.org/jira/browse/CAMEL-9564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jay mann updated CAMEL-9564:
----------------------------
    Description: 
EndpointHelper.resolveReferenceListParameter can sometimes return immutable 
lists, which can cause issues when other components try to add items to those 
lists.

The fact that other endpoints (like jetty-common JettyHttpComponent [enableCors 
line 279]) can add other components into the lists can cause hard to track down 
failures.

Sorry don't have a patch file, but the lines i would fix in EndpointHelper.java 
would be:

line 350: return Collections.emptyList();

line 360: return Arrays.asList(elements.size())

These should just return ArrayLists.


I know these parameters should optionally be Lists already, and this is a 
slight performance hit when starting up, but i think it's better than trying to 
figure out what went wrong when it fails.

My particular scenario was adding a 

  was:
EndpointHelper.resolveReferenceListParameter can sometimes return immutable 
lists, which can cause issues when other components try to add items to those 
lists.

The fact that other endpoints (like jetty-common [enableCors]) can add other 
components into the lists can cause hard to track down failures.

Sorry don't have a patch file, but the lines i would fix in EndpointHelper.java 
would be:

line 350: return Collections.emptyList();

line 360: return Arrays.asList(elements.size())

These should just return ArrayLists.


I know these parameters should optionally be Lists already, and this is a 
slight performance hit when starting up, but i think it's better than trying to 
figure out what went wrong when it fails.


> EndpointHelper.resolveReferenceListParameter should not return immutable lists
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-9564
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9564
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.16.1
>            Reporter: Jay mann
>            Priority: Minor
>
> EndpointHelper.resolveReferenceListParameter can sometimes return immutable 
> lists, which can cause issues when other components try to add items to those 
> lists.
> The fact that other endpoints (like jetty-common JettyHttpComponent 
> [enableCors line 279]) can add other components into the lists can cause hard 
> to track down failures.
> Sorry don't have a patch file, but the lines i would fix in 
> EndpointHelper.java would be:
> line 350: return Collections.emptyList();
> line 360: return Arrays.asList(elements.size())
> These should just return ArrayLists.
> I know these parameters should optionally be Lists already, and this is a 
> slight performance hit when starting up, but i think it's better than trying 
> to figure out what went wrong when it fails.
> My particular scenario was adding a 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to