private AbstractBundle[] sortByDependencies(AbstractBundle[] bundles, int size) { synchronized (framework.bundles) { List descList = new ArrayList(size); for (int i = 0; i < size; i++) { BundleDescription desc = bundles[i].getBundleDescription(); if (desc != null) descList.add(desc); } BundleDescription[] descriptions = (BundleDescription[]) descList.toArray(new BundleDescription[descList.size()]); framework.adaptor.getPlatformAdmin().getStateHelper().sortBundles(descriptions); AbstractBundle[] sortedBundles = new AbstractBundle[descriptions.length]; for (int i = 0; i < sortedBundles.length; i++) sortedBundles[i] = framework.bundles.getBundle(descriptions[i].getBundleId()); return sortedBundles;
private static void sortByDependencies(AbstractBundle[] bundles, int start, int end) { if (end - start <= 1) return; List descList = new ArrayList(end - start); List missingDescs = new ArrayList(0); for (int i = start; i < end; i++) { BundleDescription desc = bundles[i].getBundleDescription(); if (desc != null) descList.add(desc); else missingDescs.add(bundles[i]); } if (descList.size() <= 1) return; BundleDescription[] descriptions = (BundleDescription[]) descList.toArray(new BundleDescription[descList.size()]); framework.adaptor.getPlatformAdmin().getStateHelper().sortBundles(descriptions); for (int i = start; i < descriptions.length + start; i++) bundles[i] = framework.bundles.getBundle(descriptions[i - start].getBundleId()); if (missingDescs.size() > 0) { Iterator missing = missingDescs.iterator(); for (int i = start + descriptions.length; i < end && missing.hasNext(); i++) bundles[i] = (AbstractBundle) missing.next();
	private AbstractBundle[] sortByDependencies(AbstractBundle[] bundles, int size) {		synchronized (framework.bundles) {			List descList = new ArrayList(size);			for (int i = 0; i < size; i++) {				BundleDescription desc = bundles[i].getBundleDescription();				if (desc != null)					descList.add(desc);			}			BundleDescription[] descriptions = (BundleDescription[]) descList.toArray(new BundleDescription[descList.size()]);			framework.adaptor.getPlatformAdmin().getStateHelper().sortBundles(descriptions);			AbstractBundle[] sortedBundles = new AbstractBundle[descriptions.length];			for (int i = 0; i < sortedBundles.length; i++)				sortedBundles[i] = framework.bundles.getBundle(descriptions[i].getBundleId());			return sortedBundles;		}	}