ArrayList list = (ArrayList) bundlesByGlobalName.get(globalName); if (list != null) { list.remove(bundle);
Bundle[] bundles = (Bundle[]) bundlesByGlobalName.get(globalName); if (bundles != null) {   int numRemoved=0; for (int i=0; i<bundles.length; i++) { if (bundle == bundles[i]) { numRemoved++; bundles[i]=null; } } if (numRemoved>0) { if (bundles.length-numRemoved <= 0) {  bundlesByGlobalName.remove(globalName); } else {  Bundle[] newBundles = new Bundle[bundles.length-numRemoved]; int indexCnt=0; for (int i=0; i<bundles.length; i++) { if (bundles[i] != null) { newBundles[indexCnt] = bundles[i]; indexCnt++; } } bundlesByGlobalName.put(globalName,newBundles); } }
	public boolean remove(Bundle bundle) {		boolean removed = bundlesById.remove(bundle);		if (removed) {			bundlesByInstallOrder.remove(bundle);			String globalName = bundle.getGlobalName();			if (globalName != null) {				ArrayList list = (ArrayList) bundlesByGlobalName.get(globalName);				if (list != null) {					list.remove(bundle);				}			}		}		return removed;	}