exp.setDropped(false); }
	private boolean resolveImport(ResolverImport imp, boolean checkReexportsFromRequires) {		if (DEBUG_IMPORTS)			ResolverImpl.log("Trying to resolve: " + imp.getBundle() + ", " + imp.getName()); //$NON-NLS-1$ //$NON-NLS-2$		if (imp.getMatchingExport() != null) {			// Check for unrecorded cyclic dependency			if (imp.getMatchingExport().getExporter().getState() == ResolverBundle.RESOLVING) {				cyclicDependencies.put(imp.getMatchingExport().getExporter(), imp.getBundle());				imp.getBundle().recordCyclicDependency(imp.getMatchingExport().getExporter());			}			if (DEBUG_IMPORTS)				ResolverImpl.log("  - already wired"); //$NON-NLS-1$			return true; // Already wired (due to grouping dependencies) so just return		}		VersionSupplier[] exports = resolverExports.getArray(imp.getName());		for (int i = 0; i < exports.length; i++) {			ResolverExport export = (ResolverExport) exports[i];			if (DEBUG_IMPORTS)				ResolverImpl.log("CHECKING: " + export.getExporter().getBundle() + ", " + exports[i].getName()); //$NON-NLS-1$ //$NON-NLS-2$			// Check if export matches			if (imp.isSatisfiedBy(export) && imp.isNotAnUnresolvableWiring(export)) {				int originalState = export.getExporter().getState();				if (imp.isDynamic() && originalState != ResolverBundle.RESOLVED)					return false; // Must not attempt to resolve an exporter when dynamic				if (imp.getBundle() == export.getExporter() && !export.getExportPackageDescription().isRoot())					continue; // Can't wire to our own re-export				imp.setMatchingExport(export); // Wire the import to the export				if (imp.getBundle() != export.getExporter()) {					ResolverExport exp = imp.getBundle().getExport(imp);					if (exp != null) {						if (exp.getExportPackageDescription().isRoot() && !export.getExportPackageDescription().isRoot())							continue; // TODO hack to prevent imports from getting wired to re-exports if we offer a root export						resolverExports.remove(exp); // Import wins, remove export					}					if (((originalState == ResolverBundle.UNRESOLVED || !export.getExportPackageDescription().isRoot()) && !resolveBundle(export.getExporter())) || !resolverExports.contains(export)) {						if (exp != null)							resolverExports.put(exp);						imp.setMatchingExport(null);						continue; // Bundle hasn't resolved || export has not been selected and is unavailable					}				}				// If the importer has become unresolvable then stop here				if (!imp.getBundle().isResolvable())					return false;				// Check grouping dependencies				if (checkAndResolveDependencies(imp, imp.getMatchingExport())) {					if (imp.getMatchingExport() != export)						return true; // Grouping has changed the wiring, so return here					// Record any cyclic dependencies					if (imp.getBundle() != export.getExporter()) {						if (originalState == ResolverBundle.RESOLVING) {							// If the exporter was RESOLVING, we have a cyclic dependency							cyclicDependencies.put(export.getExporter(), imp.getBundle());							imp.getBundle().recordCyclicDependency(export.getExporter());						} else if (originalState == ResolverBundle.UNRESOLVED && export.getExporter().getState() == ResolverBundle.RESOLVING) {							// If the exporter has gone from UNRESOLVED to RESOLVING, we have a cyclic dependency							ArrayList exportersCyclicDependencies = export.getExporter().getCyclicDependencies();							for (int k = 0; k < exportersCyclicDependencies.size(); k++) {								ResolverBundle dependentOn = (ResolverBundle) exportersCyclicDependencies.get(k);								if (dependentOn != imp.getBundle()) {									cyclicDependencies.put(dependentOn, imp.getBundle());									imp.getBundle().recordCyclicDependency(dependentOn);								}							}						}					}					if (DEBUG_IMPORTS)						ResolverImpl.log("Found match: " + export.getExporter() + ". Wiring " + imp.getBundle() + ":" + imp.getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$					return true;				} else if (!imp.getBundle().isResolvable()) {					// If grouping has caused recursive calls to resolveImport, and the grouping has failed					// then we need to catch that here, so we don't continue trying to wire here					return false;				}			}		}		if (checkReexportsFromRequires && resolveImportReprovide(imp))			return true; // A reprovide satisfies imp		if (imp.isOptional())			return true; // If the import is optional then just return true		return false;	}