BundleDescription[] requiredBundles = bundle.getResolvedRequires(); ArrayList visited = new ArrayList(requiredBundles.length); for (int i = 0; i < requiredBundles.length; i++) getPackages(requiredBundles[i], bundle.getSymbolicName(), importList, packageList, visited, strict, null);
BundleSpecification[] requires = bundle.getRequiredBundles(); ArrayList visited = new ArrayList(requires.length); for (int i = 0; i < requires.length; i++) { BundleDescription bundleSupplier = (BundleDescription) requires[i].getSupplier(); if (bundleSupplier != null) getPackages(bundleSupplier, bundle.getSymbolicName(), importList, packageList, visited, strict, null); }
	public ExportPackageDescription[] getVisiblePackages(BundleDescription bundle) {		StateImpl state = (StateImpl) bundle.getContainingState();		boolean strict = false;		if (state != null)			strict = state.inStrictMode();		ArrayList packageList = new ArrayList(); // list of all ExportPackageDescriptions that are visible		ArrayList importList = new ArrayList(); // list of package names which are directly imported		// get the list of directly imported packages first.		ExportPackageDescription[] resolvedImports = bundle.getResolvedImports();		for (int i = 0; i < resolvedImports.length; i++) {			packageList.add(resolvedImports[i]);			// get the sources of the required bundles of the exporter			BundleDescription[] exporterRequires = resolvedImports[i].getExporter().getResolvedRequires();			ArrayList visited = new ArrayList();			for (int j = 0; j < exporterRequires.length; j++)				getPackages(exporterRequires[j], bundle.getSymbolicName(), importList, packageList, visited, strict, resolvedImports[i].getName());			importList.add(resolvedImports[i].getName()); // besure to add to direct import list		}		// now find all the packages that are visible from required bundles		BundleDescription[] requiredBundles = bundle.getResolvedRequires();		ArrayList visited = new ArrayList(requiredBundles.length);		for (int i = 0; i < requiredBundles.length; i++)			getPackages(requiredBundles[i], bundle.getSymbolicName(), importList, packageList, visited, strict, null);		return (ExportPackageDescription[]) packageList.toArray(new ExportPackageDescription[packageList.size()]);	}