You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Lucas Galfaso <lg...@gmail.com> on 2011/10/06 18:28:53 UTC
Filter parameter is ignored at getServiceReferences
Hi All,
I just started doing some tests with Felix Framework 4.0 and it looks like
public <S> Collection<ServiceReference<S>>
BundleContext::getServiceReferences(Class<S> clazz, String filter)
is ignoring the filter parameter, looking at BundleContextImpl code,
it looks like that is the case
public <S> Collection<ServiceReference<S>> getServiceReferences(
Class<S> clazz, String filter)
throws InvalidSyntaxException
{
ServiceReference<S>[] refs =
(ServiceReference<S>[])
getServiceReferences(clazz.getName(), null); /// The filter param
should be here instead of the null.
return (refs == null)
? Collections.EMPTY_LIST
: (Collection<ServiceReference<S>>) Arrays.asList(refs);
}
Thanks,
Lucas
Re: Filter parameter is ignored at getServiceReferences
Posted by Lucas Galfaso <lg...@gmail.com>.
Just created one.
Thanks
On Thu, Oct 6, 2011 at 2:06 PM, Richard S. Hall <he...@ungoverned.org> wrote:
> Yes, that looks like an oversight, did you open an issue for it? We'll do a 4.0.1 release next week hopefully and did this as well as another issue with singletons.
>
> Until then, just use the non-generic version of the method.
>
> --
> Sent from my phone, please excuse my brevity.
>
> Lucas Galfaso <lg...@gmail.com> wrote:
>
> Hi All,
> I just started doing some tests with Felix Framework 4.0 and it looks like
> public <S> Collection<ServiceReference<S>>
> BundleContext::getServiceReferences(Class<S> clazz, String filter)
>
> is ignoring the filter parameter, looking at BundleContextImpl code,
> it looks like that is the case
>
> public <S> Collection<ServiceReference<S>> getServiceReferences(
> Class<S> clazz, String filter)
> throws InvalidSyntaxException
> {
> ServiceReference<S>[] refs =
> (ServiceReference<S>[])
> getServiceReferences(clazz.getName(), null); /// The filter param
> should be here instead of the null.
> return (refs == null)
> ? Collections.EMPTY_LIST
> : (Collection<ServiceReference<S>>) Arrays.asList(refs);
> }
>
>
> Thanks,
> Lucas
>
>
Re: Filter parameter is ignored at getServiceReferences
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Yes, that looks like an oversight, did you open an issue for it? We'll do a 4.0.1 release next week hopefully and did this as well as another issue with singletons.
Until then, just use the non-generic version of the method.
--
Sent from my phone, please excuse my brevity.
Lucas Galfaso <lg...@gmail.com> wrote:
Hi All,
I just started doing some tests with Felix Framework 4.0 and it looks like
public <S> Collection<ServiceReference<S>>
BundleContext::getServiceReferences(Class<S> clazz, String filter)
is ignoring the filter parameter, looking at BundleContextImpl code,
it looks like that is the case
public <S> Collection<ServiceReference<S>> getServiceReferences(
Class<S> clazz, String filter)
throws InvalidSyntaxException
{
ServiceReference<S>[] refs =
(ServiceReference<S>[])
getServiceReferences(clazz.getName(), null); /// The filter param
should be here instead of the null.
return (refs == null)
? Collections.EMPTY_LIST
: (Collection<ServiceReference<S>>) Arrays.asList(refs);
}
Thanks,
Lucas