{  if (closed) { return; }  ServiceReference reference = event.getServiceReference();  switch (event.getType()) { case ServiceEvent.REGISTERED: case ServiceEvent.MODIFIED: if (filter.match(reference)) { track(reference);  } else { untrack(reference);  }  break;  case ServiceEvent.UNREGISTERING: untrack(reference);   break; } }
{  synchronized (this) { if (closed) { return; } }  ServiceReference reference = event.getServiceReference();  switch (event.getType()) { case ServiceEvent.REGISTERED: case ServiceEvent.MODIFIED: if (listenerFilter != null) { track(reference);  } else { if (filter.match(reference)) { track(reference);  } else { untrack(reference);  } } break;  case ServiceEvent.UNREGISTERING: untrack(reference);   break; } }
        public void serviceChanged(ServiceEvent event)        {            /* Check if we had a delayed call (which could happen when we close). */            if (closed)            {                return;            }            ServiceReference reference = event.getServiceReference();            switch (event.getType())            {                case ServiceEvent.REGISTERED:                case ServiceEvent.MODIFIED:                    if (filter.match(reference))                    {                        track(reference);                        /* If the customizer throws an unchecked exception, it is safe to let it propagate */                    }                    else                    {                        untrack(reference);                        /* If the customizer throws an unchecked exception, it is safe to let it propagate */                    }                    break;                case ServiceEvent.UNREGISTERING:                    untrack(reference);                    /* If the customizer throws an unchecked exception, it is safe to let it propagate */                    break;            }        }