FELIX-938: fileinstall try to start too many bundles

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@805479 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
index 6f0a933..7f3069c 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
@@ -421,18 +421,15 @@
             refresh();
         }
 
-        // Try to start all the bundles that we could not start last time.
-        // Make a copy, because start() changes the underlying collection
-        start(new HashSet(startupFailures));
-
-        if (startBundles
-            && ((uninstalledBundles.size() > 0)
-                || (updatedBundles.size() > 0)
-                || (installedBundles.size() > 0)))
+        if (startBundles)
         {
-            // Something has changed in the system, so
-            // try to start all the bundles.
-            startAllBundles();
+            // Try to start all the bundles that we could not start last time.
+            // Make a copy, because start() changes the underlying collection
+            start(new HashSet(startupFailures));
+            // Start updated bundles.
+            start(updatedBundles);
+            // Start newly installed bundles.
+            start(installedBundles);
         }
     }
 
@@ -869,16 +866,4 @@
         }
     }
 
-    /**
-     * Start all bundles that we are currently managing.
-     */
-    private void startAllBundles()
-    {
-        for (Iterator jars = currentManagedBundles.values().iterator(); jars.hasNext(); )
-        {
-            Jar jar = (Jar) jars.next();
-            Bundle bundle = context.getBundle(jar.getBundleId());
-            start(bundle);
-        }
-    }
 }