if (bundleSpec != null) { Bundle bundle = framework.getBundle(bundleSpec.getBundleId()); if (bundle == null || !bundle.checkExportPackagePermission(packageSpecs[i].getName()))
if (bundleSpec == null) continue; Bundle bundle = framework.getBundle(bundleSpec.getBundleId()); if (bundle == null) { BundleException be = new BundleException(Msg.formatter.getString("BUNDLE_NOT_IN_FRAMEWORK",bundleSpec)); framework.publishFrameworkEvent(FrameworkEvent.ERROR,framework.systemBundle,be); continue; }   if (!bundle.checkExportPackagePermission(packageSpecs[i].getName())) continue;  HostSpecification hostSpec = bundleSpec.getHost(); if (hostSpec != null) { bundleSpec = hostSpec.getSupplier(); if (bundleSpec == null)
	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;	}