} finally { if (Debug.DEBUG) { BundleWatcher bundleStats = framework.adaptor.getBundleWatcher(); if (bundleStats != null) bundleStats.watchBundle(this, BundleWatcher.END_UNINSTALLING); }
	protected void uninstallWorkerPrivileged() throws BundleException {		boolean unloaded = false;		//cache the bundle's headers		getHeaders();		BundleOperation storage = framework.adaptor.uninstallBundle(this.bundledata);		BundleRepository bundles = framework.getBundles();		try {			storage.begin();			boolean exporting;			int st = getState();			synchronized (bundles) {				bundles.remove(this); /* remove before calling unload */				exporting = unload();			}			// send out unresolved events outside synch block (defect #80610)			if (st == RESOLVED)				framework.publishBundleEvent(BundleEvent.UNRESOLVED, this);			unloaded = true;			storage.commit(exporting);			close();		} catch (BundleException e) {			try {				storage.undo();				if (unloaded) /* if we unloaded the bundle */{					synchronized (bundles) {						load(); /* reload the bundle */						bundles.add(this);					}				}			} catch (BundleException ee) {				/*				 * if we fail to load the original bundle then we are in big				 * trouble				 */				framework.publishFrameworkEvent(FrameworkEvent.ERROR, this, ee);			}			throw e;		}	}