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

Niall Couse commented on FELIX-5016:
------------------------------------

The reason is that it passes {{null}} to a variable arguments list, which is 
interpreted as an array of size one, with a null value, rather than an empty 
list.

As a result in the second clause of the if statement below gets called (from 
{{ServiceComponentRuntimeImpl}})

{code}
        public Collection<ComponentDescriptionDTO> 
getComponentDescriptionDTOs(Bundle... bundles)
        {
                List<ComponentHolder<?>> holders;
                if (bundles == null || bundles.length == 0)
                {
                        holders = componentRegistry.getComponentHolders();
                }
                else
                {
                        holders = 
componentRegistry.getComponentHolders(bundles);
                }
{code}

> [scr.compat] ScrServiceImpl.getComponents() returns no components
> -----------------------------------------------------------------
>
>                 Key: FELIX-5016
>                 URL: https://issues.apache.org/jira/browse/FELIX-5016
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr.compat-1.0.0
>            Reporter: Niall Couse
>
> In the scr.compat version of ScrServceImpl, the getComponents() method which 
> should return all components in the system, always returns null.



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

Reply via email to