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

Stefan Seifert resolved SLING-13139.
------------------------------------
    Fix Version/s: Testing OSGi Mock 3.5.8
         Assignee: Stefan Seifert
       Resolution: Fixed

good point - it's fixed with
https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/commit/1db130167123803f08836c2fc3c31274d9d8bd9b

> component.name property not equaling the component name.
> --------------------------------------------------------
>
>                 Key: SLING-13139
>                 URL: https://issues.apache.org/jira/browse/SLING-13139
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Testing OSGi Mock 3.5.6
>            Reporter: Mike Mansell
>            Assignee: Stefan Seifert
>            Priority: Major
>             Fix For: Testing OSGi Mock 3.5.8
>
>
> During the registration and activation of a service with the OsgiContext, 
> such as 
> registerInjectActivateService, an incorrect component.name is registered if 
> the component defines it's own name.
>  
> Within MapMergeUtil.propertiesMergeWithOsgiMetadata, the property
> component.name
> is automatically set. The current implementation uses the class name. 
> However, the OSGi specification (Compendium 8.1, section 112.6) indicates 
> that the property should equal the component name. The component name is 
> defined in Section 112.4.4, as the name property in the component metadata, 
> and if not present, to default to the class name.
> Therefore, the line:
> mergedProperties.put(ComponentConstants.COMPONENT_NAME, 
> targetClass.getName());
> should be
> mergedProperties.put(ComponentConstants.COMPONENT_NAME, metadata == null || 
> metadata.getName() == null ? targetClass.getName() : metadata.getName());



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to