if (existingHeaders != null)
if (!adaptor.canWrite() || existingHeaders != null)
	private Dictionary generateManifest(Dictionary originalManifest) throws BundleException {		String cacheLocation = System.getProperty(LocationManager.PROP_MANIFEST_CACHE);		if (getSymbolicName() != null) {			Headers existingHeaders = checkManifestAndParent(cacheLocation, getSymbolicName(), getVersion().toString(), manifestType);			if (existingHeaders != null)				return existingHeaders;		}		PluginConverterImpl converter = PluginConverterImpl.getDefault();		Dictionary generatedManifest;		try {			generatedManifest = converter.convertManifest(getBaseFile(), true, null, true, null);		} catch (PluginConversionException pce) {			String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CONVERTING, getBaseFile()); //$NON-NLS-1$			throw new BundleException(message, pce); //$NON-NLS-1$		}		//Now we know the symbolicId and the version of the bundle, we check to see if don't have a manifest for it already		Version version = Version.parseVersion((String) generatedManifest.get(Constants.BUNDLE_VERSION));		String symbolicName = ManifestElement.parseHeader(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME, (String) generatedManifest.get(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME))[0].getValue();		ManifestElement generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, (String) generatedManifest.get(PluginConverterImpl.GENERATED_FROM))[0];		Headers existingHeaders = checkManifestAndParent(cacheLocation, symbolicName, version.toString(), Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE)));		//We don't have a manifest.		setManifestTimeStamp(Long.parseLong(generatedFrom.getValue()));		setManifestType(Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE)));		if (existingHeaders != null)			return existingHeaders;		//merge the original manifest with the generated one		if (originalManifest != null) {			Enumeration keysEnum = originalManifest.keys();			while (keysEnum.hasMoreElements()) {				Object key = keysEnum.nextElement();				generatedManifest.put(key, originalManifest.get(key));			}		}		//write the generated manifest		File bundleManifestLocation = new File(cacheLocation, symbolicName + '_' + version.toString() + ".MF"); //$NON-NLS-1$		try {			converter.writeManifest(bundleManifestLocation, generatedManifest, true);		} catch (Exception e) {			//TODO Need to log		}		return generatedManifest;	}