if (newExports.length > 0 && addExports) {
if (newExports.length > 0 && dynamicAttach) {
	ResolverExport[] attachFragment(ResolverBundle fragment, boolean addExports) {		if (isFragment())			return new ResolverExport[0]; // cannot attach to fragments;		if (!getBundle().attachFragments() || (isResolved() && !getBundle().dynamicFragments()))			return new ResolverExport[0]; // host is restricting attachment		if (fragment.getHost().getMatchingBundles() != null && !((HostSpecification) fragment.getHost().getVersionConstraint()).isMultiHost())			return new ResolverExport[0]; // fragment is restricting attachment		ImportPackageSpecification[] newImports = fragment.getBundle().getImportPackages();		BundleSpecification[] newRequires = fragment.getBundle().getRequiredBundles();		ExportPackageDescription[] newExports = fragment.getBundle().getExportPackages();		if (constraintsConflict(newImports, newRequires))			return new ResolverExport[0]; // do not allow fragments with conflicting constraints		if (isResolved() && newExports.length > 0)			fragment.setNewFragmentExports(true);		initFragments();		if (fragments.contains(fragment))			return new ResolverExport[0];		fragments.add(fragment);		fragment.getHost().addMatchingBundle(this);		if (newImports.length > 0) {			ArrayList hostImports = new ArrayList(newImports.length);			for (int i = 0; i < newImports.length; i++)				if (!isImported(newImports[i].getName()))					hostImports.add(new ResolverImport(this, newImports[i]));			fragmentImports.put(fragment.bundleID, hostImports);		}		if (newRequires.length > 0) {			ArrayList hostRequires = new ArrayList(newRequires.length);			for (int i = 0; i < newRequires.length; i++)				if (!isRequired(newRequires[i].getName()))					hostRequires.add(new BundleConstraint(this, newRequires[i]));			fragmentRequires.put(fragment.bundleID, hostRequires);		}		ArrayList hostExports = new ArrayList(newExports.length);		if (newExports.length > 0 && addExports) {			StateObjectFactory factory = resolver.getState().getFactory();			for (int i = 0; i < newExports.length; i++) {				if (!isExported(newExports[i].getName())) {					ExportPackageDescription hostExport = factory.createExportPackageDescription(newExports[i].getName(), newExports[i].getVersion(), newExports[i].getDirectives(), newExports[i].getAttributes(), newExports[i].isRoot(), getBundle());					hostExports.add(new ResolverExport(this, hostExport));				}			}			fragmentExports.put(fragment.bundleID, hostExports);		}		return (ResolverExport[]) hostExports.toArray(new ResolverExport[hostExports.size()]);	}