Program: 13172
Project: 13172
Buggy source:
@Activate protected void activate(final ComponentContext context){
  this.context=context;
  requiredBundles=new ArrayList<String>();
  requiredBundles.addAll(Arrays.asList(defaultRequiredBundles));
  requiredServices=new ArrayList<String>();
  requiredServices.addAll(Arrays.asList(defaultRequiredServices));
  applyPropertyConfig();
  BundleContext ctx=FrameworkUtil.getBundle(HealthService.class).getBundleContext();
  tracker=initServiceTracker(ctx);
  frameworkListener=new FrameworkListener(){
    @Override public void frameworkEvent(    FrameworkEvent event){
      logger.debug("String_Node_Str",event.getType(),event.toString());
      if (event.getType() == FrameworkEvent.STARTED) {
        logger.debug("String_Node_Str");
        frameworkStarted=true;
      }
      if (frameworkStarted) {
switch (event.getType()) {
case FrameworkEvent.PACKAGES_REFRESHED:
case FrameworkEvent.STARTLEVEL_CHANGED:
case FrameworkEvent.WARNING:
case FrameworkEvent.INFO:
          break;
default :
        checkState();
    }
  }
  if (event.getType() == FrameworkEvent.STARTED) {
    if (!stateDetail.state.equals(AppState.ACTIVE_READY)) {
      scheduleCheckStartup();
    }
  }
}
}
;
svcListener=new ServiceListener(){
@Override public void serviceChanged(ServiceEvent event){
  logger.debug("String_Node_Str",event.getType(),event.toString());
  if (frameworkStarted) {
switch (event.getType()) {
case ServiceEvent.REGISTERED:
case ServiceEvent.UNREGISTERING:
case ServiceEvent.MODIFIED:
      checkState();
    break;
}
}
}
}
;
bundleListener=new BundleListener(){
@Override public void bundleChanged(BundleEvent event){
logger.debug("String_Node_Str",event.getType(),event.toString());
if (frameworkStarted) {
switch (event.getType()) {
case BundleEvent.STARTED:
case BundleEvent.STOPPED:
case BundleEvent.UNRESOLVED:
  checkState();
break;
case BundleEvent.RESOLVED:
if (isFragment(event.getBundle())) {
checkState();
}
break;
}
}
}
}
;
context.getBundleContext().addServiceListener(svcListener);
context.getBundleContext().addBundleListener(bundleListener);
context.getBundleContext().addFrameworkListener(frameworkListener);
router.addRoute(uriTemplate("String_Node_Str"),new OsInfoResourceProvider());
router.addRoute(uriTemplate("String_Node_Str"),new MemoryInfoResourceProvider());
router.addRoute(uriTemplate("String_Node_Str"),new ReconInfoResourceProvider());
router.addRoute(uriTemplate("String_Node_Str"),new DatabaseInfoResourceProvider());
logger.info("String_Node_Str");
}

Fixed version (ground truth):
@Activate protected void activate(final ComponentContext context){
  this.context=context;
  requiredBundles=new ArrayList<String>();
  requiredBundles.addAll(Arrays.asList(defaultRequiredBundles));
  requiredServices=new ArrayList<String>();
  requiredServices.addAll(Arrays.asList(defaultRequiredServices));
  applyPropertyConfig();
  frameworkStatusService=FrameworkStatusService.getInstance();
  BundleContext ctx=FrameworkUtil.getBundle(HealthService.class).getBundleContext();
  tracker=initServiceTracker(ctx);
  frameworkListener=new FrameworkListener(){
    @Override public void frameworkEvent(    FrameworkEvent event){
      final int eventType=event.getType();
      logger.debug("String_Node_Str",eventType,event.toString());
      frameworkStatusService.setFrameworkStatus(eventType);
      if (eventType == FrameworkEvent.STARTED) {
        logger.debug("String_Node_Str");
        frameworkStarted=true;
      }
      if (frameworkStarted) {
switch (eventType) {
case FrameworkEvent.PACKAGES_REFRESHED:
case FrameworkEvent.STARTLEVEL_CHANGED:
case FrameworkEvent.WARNING:
case FrameworkEvent.INFO:
          break;
default :
        checkState();
    }
  }
  if (eventType == FrameworkEvent.STARTED) {
    if (!stateDetail.state.equals(AppState.ACTIVE_READY)) {
      scheduleCheckStartup(serviceStartMax);
    }
  }
}
}
;
svcListener=new ServiceListener(){
@Override public void serviceChanged(ServiceEvent event){
  logger.debug("String_Node_Str",event.getType(),event.toString());
  if (frameworkStarted) {
switch (event.getType()) {
case ServiceEvent.REGISTERED:
case ServiceEvent.UNREGISTERING:
case ServiceEvent.MODIFIED:
      checkState();
    break;
}
}
}
}
;
bundleListener=new BundleListener(){
@Override public void bundleChanged(BundleEvent event){
logger.debug("String_Node_Str",event.getType(),event.toString());
if (frameworkStarted) {
switch (event.getType()) {
case BundleEvent.STARTED:
case BundleEvent.STOPPED:
case BundleEvent.UNRESOLVED:
  checkState();
break;
case BundleEvent.RESOLVED:
if (isFragment(event.getBundle())) {
checkState();
}
break;
}
}
}
}
;
context.getBundleContext().addServiceListener(svcListener);
context.getBundleContext().addBundleListener(bundleListener);
context.getBundleContext().addFrameworkListener(frameworkListener);
router.addRoute(uriTemplate("String_Node_Str"),new OsInfoResourceProvider());
router.addRoute(uriTemplate("String_Node_Str"),new MemoryInfoResourceProvider());
router.addRoute(uriTemplate("String_Node_Str"),new ReconInfoResourceProvider());
router.addRoute(uriTemplate("String_Node_Str"),new DatabaseInfoResourceProvider());
if (frameworkStatusService.getFrameworkStatus() == FrameworkEvent.STARTED || frameworkStatusService.getFrameworkStatus() == FrameworkEvent.PACKAGES_REFRESHED || frameworkStatusService.getFrameworkStatus() == FrameworkEvent.STARTLEVEL_CHANGED || frameworkStatusService.getFrameworkStatus() == FrameworkEvent.WARNING || frameworkStatusService.getFrameworkStatus() == FrameworkEvent.INFO) {
scheduleCheckStartup(2000);
}
logger.info("String_Node_Str");
}