if (stateManager == null || isReadOnly() || timeStamp == stateManager.getSystemState().getTimeStamp())
if (stateManager == null || isReadOnly() || (timeStamp == stateManager.getSystemState().getTimeStamp() && !stateManager.saveNeeded()))
	private void saveBundleDatas() {		// the cache and the state match		if (stateManager == null || isReadOnly() || timeStamp == stateManager.getSystemState().getTimeStamp())			return;		try {			ManagedOutputStream fmos = storageManager.getOutputStream(LocationManager.BUNDLE_DATA_FILE);			DataOutputStream out = new DataOutputStream(new BufferedOutputStream(fmos));			boolean error = true;			try {				out.writeByte(BUNDLEDATA_VERSION);				out.writeLong(stateManager.getSystemState().getTimeStamp());				out.writeInt(initialBundleStartLevel);				out.writeLong(nextId);				StorageHook[] storageHooks = adaptor.getHookRegistry().getStorageHooks();				out.writeInt(storageHooks.length);				for (int i = 0; i < storageHooks.length; i++) {					out.writeUTF((String) storageHooks[i].getKey());					out.writeInt(storageHooks[i].getStorageVersion());				}				Bundle[] bundles = context.getBundles();				out.writeInt(bundles.length);				for (int i = 0; i < bundles.length; i++) {					long id = bundles[i].getBundleId();					out.writeLong(id);					if (id != 0) {						BundleData data = ((org.eclipse.osgi.framework.internal.core.AbstractBundle) bundles[i]).getBundleData();						saveBaseData((BaseData) data, out);					}				}				out.close();				// update the 'timeStamp' after the changed Meta data is saved.				timeStamp = stateManager.getSystemState().getTimeStamp();				error = false;			} finally {				// if something happens, don't close a corrupt file				if (error) {					fmos.abort();					try {						out.close();					} catch (IOException e) {/*ignore*/					}				}			}		} catch (IOException e) {			adaptor.getFrameworkLog().log(new FrameworkEvent(FrameworkEvent.ERROR, context.getBundle(), e));			return;		}	}