HostSpecification hostSpec = bundleSpec.getHost(); if (hostSpec != null) { bundleSpec = hostSpec.getSupplier(); if (bundleSpec == null) continue; bundle = framework.getBundle(bundleSpec.getBundleId()); }  if (bundle != null && bundle.isResolved() && bundle instanceof BundleHost) { ExportedPackageImpl packagesource = new ExportedPackageImpl(packageSpecs[i], ((BundleHost)bundle).getLoaderProxy()); packageSet.add(packagesource); } else {  } } else {
if (bundle.isResolved() && bundle instanceof BundleHost) { ExportedPackageImpl packagesource = new ExportedPackageImpl(packageSpecs[i], ((BundleHost) bundle).getLoaderProxy()); packageSet.add(packagesource);
	private KeyedHashSet getExportedPackages(KeyedHashSet packageSet) {		State state = framework.adaptor.getState();		PackageSpecification[] packageSpecs = state.getExportedPackages();		for (int i = 0; i < packageSpecs.length; i++) {			BundleDescription bundleSpec = packageSpecs[i].getSupplier();			if (bundleSpec != null) {				Bundle bundle = framework.getBundle(bundleSpec.getBundleId());				if (bundle == null || !bundle.checkExportPackagePermission(packageSpecs[i].getName()))					continue;				HostSpecification hostSpec = bundleSpec.getHost();				if (hostSpec != null) {					bundleSpec = hostSpec.getSupplier();					if (bundleSpec == null)						continue;					bundle = framework.getBundle(bundleSpec.getBundleId());				}								if (bundle != null && bundle.isResolved() && bundle instanceof BundleHost) {					ExportedPackageImpl packagesource = new ExportedPackageImpl(packageSpecs[i], ((BundleHost)bundle).getLoaderProxy());					packageSet.add(packagesource);				} else {					// TODO log error				}			} else {				// TODO log error			}		}		return packageSet;	}