[ https://issues.apache.org/jira/browse/FELIX-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stephen Flynn updated FELIX-2275: --------------------------------- Attachment: ExampleComponent.java serviceComponents.xml Example annotated component and its generated descriptor showing references in wrong order. > Component descriptor reference elements are not ordered > ------------------------------------------------------- > > Key: FELIX-2275 > URL: https://issues.apache.org/jira/browse/FELIX-2275 > Project: Felix > Issue Type: Bug > Components: Maven SCR Plugin > Affects Versions: maven-scr-plugin-1.4.2 > Reporter: Stephen Flynn > Attachments: ExampleComponent.java, serviceComponents.xml > > > We use SCR annotations (1.2.0) and the SCR Maven Plug-in (1.4.2) to generate > DS 1.1 component descriptors. All works well except for one issue - we cannot > find a way to control the order of <reference/> elements in the generated > descriptor through the @Reference annotation. A cursory glance suggests that > <reference/> elements generated by the plug-in are not ordered in any way. > The order of binding is significant. From the 4.2 Compendium spec.... > *112.5.7 Binding Services* > "When binding services, the references are processed in the order in which > they are specified in the component description. That is, target services from > the first specified reference are bound before services from the next > specified > reference." > We can work around this by manually creating descriptors but this is > sub-optimal for obvious reasons. > This appears to be caused by capturing references in a HashMap in the class > SCRDescriptorGenerator.java. Should probably be a LinkedHashMap instead. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira