for (int i = 0; i < matchingBundles.length; i++)
for (int i = 0; i < matchingBundles.length; i++) {
	private void stateResolveBundle(ResolverBundle rb) {		// Gather selected exports		ResolverExport[] exports = rb.getSelectedExports();		ArrayList selectedExports = new ArrayList(exports.length);		for (int i = 0; i < exports.length; i++) {			selectedExports.add(exports[i].getExportPackageDescription());		}		ExportPackageDescription[] selectedExportsArray = (ExportPackageDescription[]) selectedExports.toArray(new ExportPackageDescription[selectedExports.size()]);		// Gather exports that have been wired to		ResolverImport[] imports = rb.getImportPackages();		ArrayList exportsWiredTo = new ArrayList(imports.length);		for (int i = 0; i < imports.length; i++) {			if (imports[i].getMatchingExport() != null) {				exportsWiredTo.add(imports[i].getMatchingExport().getExportPackageDescription());			}		}		ExportPackageDescription[] exportsWiredToArray = (ExportPackageDescription[]) exportsWiredTo.toArray(new ExportPackageDescription[exportsWiredTo.size()]);		// Gather bundles that have been wired to		BundleConstraint[] requires = rb.getRequires();		ArrayList bundlesWiredTo = new ArrayList(requires.length);		for (int i = 0; i < requires.length; i++)			if (requires[i].getMatchingBundle() != null)				bundlesWiredTo.add(requires[i].getMatchingBundle().getBundle());		BundleDescription[] bundlesWiredToArray = (BundleDescription[]) bundlesWiredTo.toArray(new BundleDescription[bundlesWiredTo.size()]);		BundleDescription[] hostBundles = null;		if (rb.isFragment()) {			ResolverBundle[] matchingBundles = rb.getHost().getMatchingBundles();			if (matchingBundles != null && matchingBundles.length > 0) {				hostBundles = new BundleDescription[matchingBundles.length];				for (int i = 0; i < matchingBundles.length; i++)					hostBundles[i] = matchingBundles[i].getBundle();			}		}		// Resolve the bundle in the state		state.resolveBundle(rb.getBundle(), true, hostBundles, selectedExportsArray, bundlesWiredToArray, exportsWiredToArray);	}