From bef1cc9df1203fe05e5781dbe7b015f317a70cf5 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Mon, 30 Apr 2012 12:50:16 -0500 Subject: Bug 365722 - "eclipse -clean" enters infinite restart loop --- .../osgi/framework/internal/core/PackageAdminImpl.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java index 91d5aea3f..f9e14605d 100644 --- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java +++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/PackageAdminImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -224,7 +224,6 @@ public class PackageAdminImpl implements PackageAdmin, FrameworkWiring { synchronized (framework.bundles) { // now collect the descriptions to refresh List results = new ArrayList(numBundles); - BundleDelta[] addDeltas = null; for (int i = 0; i < numBundles; i++) { BundleDescription description = ((AbstractBundle) bundles[i]).getBundleDescription(); if (description != null && description.getBundleId() != 0 && !results.contains(description)) @@ -233,13 +232,11 @@ public class PackageAdminImpl implements PackageAdmin, FrameworkWiring { // add in any bundles that have the same symbolic name see bug (169593) AbstractBundle[] sameNames = framework.bundles.getBundles(bundles[i].getSymbolicName()); if (sameNames != null && sameNames.length > 1) { - if (addDeltas == null) - addDeltas = systemState.getChanges().getChanges(BundleDelta.ADDED, false); for (int j = 0; j < sameNames.length; j++) if (sameNames[j] != bundles[i]) { BundleDescription sameName = sameNames[j].getBundleDescription(); if (sameName != null && sameName.getBundleId() != 0 && !results.contains(sameName)) { - if (checkExtensionBundle(sameName, addDeltas)) + if (checkExtensionBundle(sameName)) results.add(sameName); } } @@ -289,12 +286,13 @@ public class PackageAdminImpl implements PackageAdmin, FrameworkWiring { } } - private boolean checkExtensionBundle(BundleDescription sameName, BundleDelta[] addDeltas) { + private boolean checkExtensionBundle(BundleDescription sameName) { if (sameName.getHost() == null || !sameName.isResolved()) return true; // only do this extra check for resolved fragment bundles - // only add fragments of the system bundle when newly added bundles exist. - if (((BundleDescription) sameName.getHost().getSupplier()).getBundleId() != 0 || addDeltas.length > 0) + // only add fragments if they are not for the system bundle + if (((BundleDescription) sameName.getHost().getSupplier()).getBundleId() != 0) return true; + // never do this for resolved system bundle fragments return false; } -- cgit v1.2.3