groupingChecker.addImportConstraints(bundle);
	private boolean resolveBundle(ResolverBundle bundle) {		if (bundle.isFragment())			return false;		if (!bundle.isResolvable()) {			if (DEBUG)				ResolverImpl.log("  - " + bundle + " is unresolvable"); //$NON-NLS-1$ //$NON-NLS-2$			return false;		}		if (bundle.getState() == ResolverBundle.RESOLVED) {			// 'bundle' is already resolved so just return			if (DEBUG)				ResolverImpl.log("  - " + bundle + " already resolved"); //$NON-NLS-1$ //$NON-NLS-2$			return true;		} else if (bundle.getState() == ResolverBundle.UNRESOLVED) {			// 'bundle' is UNRESOLVED so move to RESOLVING			bundle.clearWires();			setBundleResolving(bundle);		}		boolean failed = false;		// Check for singletons		if (bundle.getBundle().isSingleton()) {			VersionSupplier[] sameName = resolverBundles.getArray(bundle.getName());			if (sameName.length > 1) // Need to check if one is already resolved				for (int i = 0; i < sameName.length; i++) {					if (sameName[i] == bundle || !sameName[i].getBundle().isSingleton())						continue; // Ignore the bundle we are resolving and non-singletons					if (((ResolverBundle) sameName[i]).getBundle().isResolved()) {						failed = true; // Must fail since there is already a resolved bundle						break;					}				}		}		if (!failed) {			// Iterate thru required bundles of 'bundle' trying to find matching bundles.			BundleConstraint[] requires = bundle.getRequires();			for (int i = 0; i < requires.length; i++) {				if (!resolveRequire(requires[i])) {					if (DEBUG || DEBUG_REQUIRES)						ResolverImpl.log("** REQUIRE " + requires[i].getVersionConstraint().getName() + "[" + requires[i].getActualBundle() + "] failed to resolve"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$					// If the require has failed to resolve and it is from a fragment, then remove the fragment from the host					if (requires[i].isFromFragment()) {						resolverExports.remove(bundle.detachFragment((ResolverBundle) bundleMapping.get(requires[i].getVersionConstraint().getBundle())));						continue;					}					failed = true;					break;				}			}		}		if (!failed) {			// Iterate thru imports of 'bundle' trying to find matching exports.			ResolverImport[] imports = bundle.getImportPackages();			for (int i = 0; i < imports.length; i++) {				// Only resolve non-dynamic imports here				if (!imports[i].isDynamic()) {					if (!resolveImport(imports[i], true)) {						if (DEBUG || DEBUG_IMPORTS)							ResolverImpl.log("** IMPORT " + imports[i].getName() + "[" + imports[i].getActualBundle() + "] failed to resolve"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$						// If the import has failed to resolve and it is from a fragment, then remove the fragment from the host						if (imports[i].isFromFragment()) {							resolverExports.remove(bundle.detachFragment((ResolverBundle) bundleMapping.get(imports[i].getImportPackageSpecification().getBundle())));							continue;						}						failed = true;						break;					}				}			}		}		// Need to check that all mandatory imports are wired. If they are then		// set the bundle RESOLVED, otherwise set it back to UNRESOLVED		boolean fullyWired = bundle.isFullyWired();		if (!failed && fullyWired && !bundle.isDependentOnCycle()) {			if (!groupingChecker.checkRequiresConstraints(bundle)) {				setBundleUnresolved(bundle, false);				if (DEBUG)					ResolverImpl.log(bundle + " NOT RESOLVED due to propagation or grouping constraints"); //$NON-NLS-1$			} else {				setBundleResolved(bundle);				if (DEBUG)					ResolverImpl.log(bundle + " RESOLVED"); //$NON-NLS-1$			}		} else if (failed || !fullyWired) {			setBundleUnresolved(bundle, false);			if (DEBUG)				ResolverImpl.log(bundle + " NOT RESOLVED"); //$NON-NLS-1$		}		if (!failed && fullyWired) {			groupingChecker.addReExportConstraints(bundle);			groupingChecker.addImportConstraints(bundle);			groupingChecker.addRequireConstraints(bundle.getExportPackages(), bundle);		}		// Check cyclic dependencies		ArrayList v = cyclicDependencies.remove(bundle);		if (v != null) {			// We have some cyclic dependencies on 'bundle', so iterate thru			// them and inform each one whether 'bundle' has resolved or not			for (int i = 0; i < v.size(); i++) {				ResolverBundle dependent = (ResolverBundle) v.get(i);				if (bundle.isDependentOnUnresolvedFragment(dependent)) {					dependent.cyclicDependencyFailed(bundle);					setBundleUnresolved(dependent, false);					if (DEBUG_CYCLES)						ResolverImpl.log("Setting dependent bundle (" + dependent + ") to unresolved (due to fragment)"); //$NON-NLS-1$ //$NON-NLS-2$				} else if (bundle.getState() == ResolverBundle.RESOLVED) {					// Tell dependent bundles that we have resolved so that they can resolve					// (they may be dependent on other bundles as well though)					if (dependent.cyclicDependencyResolved(bundle)) {						setBundleResolved(dependent);						if (DEBUG_CYCLES)							ResolverImpl.log("Telling dependent bundle (" + dependent + ") that " + bundle + " has resolved"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$					}				} else if (bundle.getState() == ResolverBundle.UNRESOLVED) {					// Tell dependent bundles that we have failed to					// resolve - this forces them to be unresolved					dependent.cyclicDependencyFailed(bundle);					setBundleUnresolved(dependent, false);					if (DEBUG_CYCLES)						ResolverImpl.log("Setting dependent bundle (" + dependent + ") to unresolved"); //$NON-NLS-1$ //$NON-NLS-2$				}			}		}		if (bundle.getState() == ResolverBundle.UNRESOLVED)			bundle.setResolvable(false); // Set it to unresolvable so we don't attempt to resolve it again in this round		// tell the state what we resolved the constraints to		stateResolveConstraints(bundle);		return bundle.getState() != ResolverBundle.UNRESOLVED;	}