Iterator it = componentDescriptions.iterator(); while (it.hasNext()) { ComponentDescription componentDescription = (ComponentDescription) it.next(); validate(componentDescription); if (componentDescription.isAutoenable() && componentDescription.isValid()) { componentDescription.setEnabled(true); enableComponentDescriptions.add(componentDescription);
Iterator it = componentDescriptions.iterator(); while (it.hasNext()) { ComponentDescription componentDescription = (ComponentDescription) it.next(); validate(componentDescription); if (componentDescription.isAutoenable() && componentDescription.isValid()) { componentDescription.setEnabled(true); enableComponentDescriptions.add(componentDescription); }
	public Object addingBundle(Bundle bundle) {		List enableComponentDescriptions = new ArrayList();		PackageAdmin packageAdmin = (PackageAdmin) packageAdminTracker.getService();		if (packageAdmin.getBundleType(bundle) != 0) {			return null; // don't process fragments.		}		Long bundleID = new Long(bundle.getBundleId());		// get the bundle's last modified date		Long bundleLastModified = new Long(bundle.getLastModified());		// get the last saved value for the bundle's last modified date		Long bundleOldLastModified = (Long) bundleToLastModified.get(bundleID);		// compare the two and if changed ( or if first time ) update the maps		if ((!bundleLastModified.equals(bundleOldLastModified)) || (bundleOldLastModified == null)) {			// get the BundleContext for this bundle (framework impl dependent)			BundleContext bundleContext = framework.getBundleContext(bundle);			// get all ComponentDescriptions for this bundle			List componentDescriptions = cache.getComponentDescriptions(bundleContext);			// update map of bundle to ComponentDescriptions			bundleToComponentDescriptions.put(bundleID, componentDescriptions);			// update bundle:lastModifiedDate map			bundleToLastModified.put(bundleID, bundleLastModified);			// for each CD in bundle set enable flag based on autoenable			Iterator it = componentDescriptions.iterator();			while (it.hasNext()) {				ComponentDescription componentDescription = (ComponentDescription) it.next();				validate(componentDescription);				if (componentDescription.isAutoenable() && componentDescription.isValid()) {					componentDescription.setEnabled(true);					enableComponentDescriptions.add(componentDescription);				}			}		}		// publish all CDs to be enabled, to resolver (add to the workqueue and		// publish event)		if (!enableComponentDescriptions.isEmpty()) {			workQueue.enqueueWork(this, ADD, enableComponentDescriptions);		}		return bundleID;	}