diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index f3f7fbb..9d6eb88 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -2674,28 +2674,6 @@
 
     void uninstallBundle(BundleImpl bundle) throws BundleException
     {
-        // Populate a set of refresh candidates. This also includes any bundles that this bundle
-        // is wired to but have previously been uninstalled.
-        List<Bundle> refreshCandidates = new ArrayList<Bundle>();
-        refreshCandidates.add(bundle); // Add this bundle first, so that it gets refreshed first later on
-        BundleRevisions bundleRevisions = bundle.adapt(BundleRevisions.class);
-        if (bundleRevisions != null)
-        {
-            for (BundleRevision br : bundleRevisions.getRevisions())
-            {
-                BundleWiring bw = br.getWiring();
-                if (bw != null)
-                {
-                    for (BundleWire wire : bw.getRequiredWires(null))
-                    {
-                        Bundle b = wire.getProvider().getBundle();
-                        if (Bundle.UNINSTALLED == b.getState() && !refreshCandidates.contains(b))
-                            refreshCandidates.add(b);
-                    }
-                }
-            }
-        }
-
         // Acquire bundle lock.
         try
         {
@@ -2799,6 +2777,28 @@
         boolean locked = acquireGlobalLock();
         if (locked)
         {
+            // Populate a set of refresh candidates. This also includes any bundles that this bundle
+            // is wired to but have previously been uninstalled.
+            List<Bundle> refreshCandidates = new ArrayList<Bundle>();
+            refreshCandidates.add(bundle); // Add this bundle first, so that it gets refreshed first
+            BundleRevisions bundleRevisions = bundle.adapt(BundleRevisions.class);
+            if (bundleRevisions != null)
+            {
+                for (BundleRevision br : bundleRevisions.getRevisions())
+                {
+                    BundleWiring bw = br.getWiring();
+                    if (bw != null)
+                    {
+                        for (BundleWire wire : bw.getRequiredWires(null))
+                        {
+                            Bundle b = wire.getProvider().getBundle();
+                            if (Bundle.UNINSTALLED == b.getState() && !refreshCandidates.contains(b))
+                                refreshCandidates.add(b);
+                        }
+                    }
+                }
+            }
+
             try
             {
                 for (Bundle b : refreshCandidates)
