if (!framework.shuttingdown) {
if (allowSetStartOnLaunchFalse()) {
  synchronized public void stop() throws BundleException {    framework.checkAdminPermission();    bDelayedStart = false;        if(framework.startLevelService != null) {      if(getStartLevel() <= framework.startLevelService.getStartLevel()) {	if(state == ACTIVE) {	  bDelayedStart = true;	}      }    }    switch (state) {    case INSTALLED:    case RESOLVED:      // We don't want this bundle to start on launch after it has been      // stopped. (Don't apply during shutdown      if (!framework.shuttingdown) {	AccessController.doPrivileged(new PrivilegedAction() {	    public Object run() {	      startOnLaunch(false);	    return null;	    }	  });      }      break;    case ACTIVE:      state = STOPPING;      Throwable savedException =	(Throwable) AccessController.doPrivileged(new PrivilegedAction() {	  public Object run() {	    Throwable res = null;	    if (!framework.shuttingdown) {	      startOnLaunch(false);	    }	    if (bactivator != null) {	      try {		bactivator.stop(bundleContext);	      } catch (Throwable e) {		res = e;	      }	      bactivator = null;	    }	    bundleContext.invalidate();	    bundleContext = null;	    removeBundleResources();	    state = RESOLVED;	    return res;	  }	});      framework.listeners.bundleChanged(new BundleEvent(BundleEvent.STOPPED, this));      if (savedException != null) {	throw new BundleException("Bundle.stop: BundleActivator stop failed",				  savedException);      }      break;    case STARTING:      // This happens if we call stop from inside the BundleActivator.start method.      // We don't allow it.      throw new BundleException("Bundle.start called from BundleActivator.stop");    case STOPPING:      // This happens if we call stop from inside the BundleActivator.stop method.      // We don't allow it.      throw new BundleException("Bundle.stop called from BundleActivator.stop");    case UNINSTALLED:      throw new IllegalStateException("Bundle.stop: Bundle is in UNINSTALLED state");    }  }