bundles = new Bundle[list.size()];
	public void add(Bundle bundle) {		bundlesByInstallOrder.add(bundle);		bundlesById.add(bundle);		String globalName = bundle.getGlobalName();		if (globalName != null) {			Bundle[] bundles = (Bundle[]) bundlesByGlobalName.get(globalName);			if (bundles == null) {				// making the initial capacity on this 1 since it				// should be rare that multiple version exist				bundles = new Bundle[1];				bundles[0] = bundle;				bundlesByGlobalName.put(globalName,bundles);				return;			}			ArrayList list = new ArrayList(bundles.length+1);			// find place to insert the bundle			Version newVersion = bundle.getVersion();			boolean added = false;			for (int i=0; i<bundles.length; i++) {				Bundle oldBundle = bundles[i];				Version oldVersion = oldBundle.getVersion();				if (!added && newVersion.isGreaterOrEqualTo(oldVersion)){					added = true;					list.add(bundle);				}				list.add(oldBundle);			}			if (!added) {				list.add(bundle);			}			list.toArray(bundles);			bundlesByGlobalName.put(globalName,bundles);		}	}