}
private Collection uninstallBundles(HashSet toUninstall) {
Collection removedBundles = new ArrayList(toUninstall.size());
for (Iterator iterator = toUninstall.iterator(); iterator.hasNext();) {
BundleInfo current = (BundleInfo) iterator.next();
Bundle[] matchingBundles = packageAdminService.getBundles(current
.getSymbolicName(), getVersionRange(current.getVersion()));
for (int j = 0; matchingBundles != null
&& j < matchingBundles.length; j++) {
try {
removedBundles.add(matchingBundles[j]);
matchingBundles[j].uninstall();