boolean bundleDiscarded = false;
	public BundleData[] getInstalledBundles() {		InputStream bundleDataStream = findBundleDataFile();		if (bundleDataStream == null)			return null;		try {			DataInputStream in = new DataInputStream(new BufferedInputStream(bundleDataStream));			try {				byte version = in.readByte();				if (version != BUNDLEDATA_VERSION)					return null;				// skip timeStamp - was read by readHeaders				in.readLong();				in.readInt();				in.readLong();				int bundleCount = in.readInt();				ArrayList result = new ArrayList(bundleCount);				long id = -1;				for (int i = 0; i < bundleCount; i++) {					try {						try {							id = in.readLong();							if (id != 0) {								EclipseBundleData data = (EclipseBundleData) getElementFactory().createBundleData(this, id);								loadMetaDataFor(data, in, version);								data.initializeExistingBundle();								if (Debug.DEBUG && Debug.DEBUG_GENERAL)									Debug.println("BundleData created: " + data); //$NON-NLS-1$								processExtension(data, EXTENSION_INITIALIZE);								result.add(data);							}						} catch (NumberFormatException e) {							// should never happen						} catch (BundleException e) {							// should never happen						}					} catch (IOException e) {						if (Debug.DEBUG && Debug.DEBUG_GENERAL) {							Debug.println("Error reading framework metadata: " + e.getMessage()); //$NON-NLS-1$ 							Debug.printStackTrace(e);						}					}				}				return (BundleData[]) result.toArray(new BundleData[result.size()]);			} finally {				in.close();			}		} catch (IOException e) {			if (Debug.DEBUG && Debug.DEBUG_GENERAL) {				Debug.println("Error reading framework metadata: " + e.getMessage()); //$NON-NLS-1$ 				Debug.printStackTrace(e);			}		}		return null;	}