if (sameNameDesc.isResolved() || sameNameDesc.getVersion().compareTo(bundle.getBundle().getVersion()) > 0) {
boolean rejectedPolicy; if (selectionPolicy == null)  rejectedPolicy = sameNameDesc.isResolved() || sameNameDesc.getVersion().compareTo(bundle.getBundle().getVersion()) > 0; else rejectedPolicy = selectionPolicy.compare(sameNameDesc, bundle.getBundle()) < 0; if (rejectedPolicy) {
	private void attachFragment(ResolverBundle bundle, ArrayList rejectedSingletons) {		if (!bundle.isFragment() || !bundle.isResolvable() || rejectedSingletons.contains(bundle.getBundle()))			return;		// select singleton fragments		if (bundle.getBundle().isSingleton()) {			BundleDescription bundleDesc = bundle.getBundle();			Object[] sameName = resolverBundles.get(bundleDesc.getName());			if (sameName.length > 1) {				// we found some other bundles with the same BSN				for (int j = 0; j < sameName.length; j++) {					BundleDescription sameNameDesc = ((ResolverBundle) sameName[j]).getBundle();					if (sameName[j] == bundle || !sameNameDesc.isSingleton() || rejectedSingletons.contains(sameNameDesc))						continue; // Ignore the bundle we are selecting, non-singletons and rejected singletons					// if the bundle sameNameDesc is resolved or has a greater version then reject the other bundle 					if (sameNameDesc.isResolved() || sameNameDesc.getVersion().compareTo(bundle.getBundle().getVersion()) > 0) {						rejectedSingletons.add(bundle.getBundle());						return;					}					// reject the bundle sameNameDesc					rejectedSingletons.add(sameNameDesc);				}			}		}		// find all available hosts to attach to.		BundleConstraint hostConstraint = bundle.getHost();		Object[] hosts = resolverBundles.get(hostConstraint.getVersionConstraint().getName());		for (int i = 0; i < hosts.length; i++)			if (((ResolverBundle) hosts[i]).isResolvable() && hostConstraint.isSatisfiedBy((ResolverBundle) hosts[i]))				resolverExports.put(((ResolverBundle) hosts[i]).attachFragment(bundle, true));	}