Is your context argument != null ?

On Fri, Jun 25, 2010 at 7:21 PM, Donald Whytock <[email protected]> wrote:
>
> One of the ServiceTracker constructors takes a Filter, but not a
> filter String.  Still, it shouldn't complain at compile time about
> (BundleContext, String, null) as parameters regardless of whether I'm
> using a bad String.
>
> My extension was called ShellTracker.  I'd extended ServiceTracker
> without making a constructor, assuming it'd use ServiceTracker's
> constructors.  So the statement that wouldn't compile was
>
> tracker = new ShellTracker(context, filterstring, null);
>
> I tried adding a constructor:
>
> Public ShellTracker(BundleContext context, String clazz,
> ServiceTrackerCustomizer custom)
>  { super(context, clazz, custom); }
>
> That compiled, but at runtime it gave me a NullPointerException when
> instantiating the ShellTracker.
>
> On Fri, Jun 25, 2010 at 12:57 PM, Richard S. Hall <[email protected]> 
> wrote:
> > On 6/25/10 12:50, Donald Whytock wrote:
> >>
> >> Hi...Trying to extend ServiceTracker rather than use a
> >> ServiceTrackerCustomizer, but when I try new ServiceTracker(context,
> >> filter, null) I get a Cannot Find Symbol for constructor
> >> ServiceTracker(BundleContext, String,<nullable>).
> >>
> >> The ServiceTracker javadoc talks about what happens if the customizer
> >> parameter is null, so I assume it can be null?
> >>
> >
> > Sure it can. Are you sure you have access to the class in your project set
> > up?
> >
> > -> richard
> >
> > p.s. The middle string parameter is not a filter, but the name of a
> > class...if you want to use a filter you need to create a filter.
> >
> >> Don
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to