ExportPackageDescription[] newExports = fragment.getBundle().getExportPackages();
	ResolverExport[] attachFragment(ResolverBundle fragment, boolean addExports) {		if (isFragment())			return new ResolverExport[0]; // cannot attach to fragments;		initFragments();		if (fragments.contains(fragment))			return new ResolverExport[0];		fragments.add(fragment);		fragment.getHost().addMatchingBundle(this);		ImportPackageSpecification[] newImports = fragment.getBundle().getImportPackages();		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);		}		BundleSpecification[] newRequires = fragment.getBundle().getRequiredBundles();		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);		}		ExportPackageDescription[] newExports = fragment.getBundle().getExportPackages();		ArrayList hostExports = new ArrayList(newExports.length);		if (newExports.length > 0 && addExports) {			StateObjectFactory factory = bundle.getContainingState().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].getGrouping(), newExports[i].getInclude(), newExports[i].getExclude(), newExports[i].getAttributes(), newExports[i].getMandatory(), newExports[i].isRoot(), bundle);					hostExports.add(new ResolverExport(this, hostExport));				}			}			fragmentExports.put(fragment.bundleID, hostExports);		}		return (ResolverExport[]) hostExports.toArray(new ResolverExport[hostExports.size()]);	}