if (state.installed.contains(bundle)
|| (bundle.getState() != Bundle.STARTING && bundle.getState() != Bundle.ACTIVE
&& bundle.adapt(BundleStartLevel.class).isPersistentlyStarted())) {
// do no start bundles when user request it
Long bundleId = bundle.getBundleId();
BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
if (bundleInfo == null || bundleInfo.isStart()) {
try {
bundle.start();
} catch (BundleException be) {
String msg = format("Could not start bundle %s in feature(s) %s: %s", bundle.getLocation(), getFeaturesContainingBundleList(bundle), be.getMessage());
throw new Exception(msg, be);