public PackageSpecification[] getExportedPackages(BundleDescription bundle) { if (!bundle.isResolved()) return new PackageSpecification[0]; PackageSpecification[] allPackages = bundle.getPackages(); PackageSpecification[] exported = new PackageSpecification[allPackages.length]; int exportedCount = 0; for (int i = 0; i < allPackages.length; i++) if (allPackages[i].isExported() && allPackages[i].getSupplier() == bundle) exported[exportedCount++] = allPackages[i]; if (exportedCount < exported.length) { PackageSpecification[] tmpExported = new PackageSpecification[exportedCount]; System.arraycopy(exported, 0, tmpExported, 0, exportedCount); exported = tmpExported;
public PackageSpecification[] getExportedPackages() { final List allExportedPackages = new ArrayList(); for (Iterator iter = resolvedBundles.iterator(); iter.hasNext(); ) { BundleDescription bundle = (BundleDescription) iter.next(); PackageSpecification[] bundlePackages = bundle.getPackages(); for (int i = 0; i < bundlePackages.length; i++) if (bundlePackages[i].isExported() && bundlePackages[i].getSupplier() == bundle) allExportedPackages.add(bundlePackages[i]);
	public PackageSpecification[] getExportedPackages(BundleDescription bundle) {		if (!bundle.isResolved())			return new PackageSpecification[0];		PackageSpecification[] allPackages = bundle.getPackages();		PackageSpecification[] exported = new PackageSpecification[allPackages.length];		int exportedCount = 0;		for (int i = 0; i < allPackages.length; i++)			if (allPackages[i].isExported() && allPackages[i].getSupplier() == bundle)				exported[exportedCount++] = allPackages[i];		if (exportedCount < exported.length) {			PackageSpecification[] tmpExported = new PackageSpecification[exportedCount];			System.arraycopy(exported, 0, tmpExported, 0, exportedCount);			exported = tmpExported;		}		return exported;	}