felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1378126 - /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
Date Tue, 28 Aug 2012 13:17:28 GMT
Author: gnodet
Date: Tue Aug 28 13:17:26 2012
New Revision: 1378126

URL: http://svn.apache.org/viewvc?rev=1378126&view=rev
Log:
[FELIX-3635] Unnecessary processing in DirectoryWatcher

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java?rev=1378126&r1=1378125&r2=1378126&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
Tue Aug 28 13:17:26 2012
@@ -481,17 +481,20 @@ public class DirectoryWatcher extends Th
         Collection uninstalledBundles = uninstall(deleted);
         Collection updatedBundles = update(modified);
         Collection installedBundles = install(created);
-        
-        Set toRefresh = new HashSet();
-        toRefresh.addAll( uninstalledBundles );
-        toRefresh.addAll(updatedBundles);
-        toRefresh.addAll( installedBundles );
-        findBundlesWithFragmentsToRefresh( toRefresh );
-        findBundlesWithOptionalPackagesToRefresh( toRefresh );
-        if (toRefresh.size() > 0)
+
+        if (!uninstalledBundles.isEmpty() || !updatedBundles.isEmpty() || !installedBundles.isEmpty())
         {
-            // Refresh if any bundle got uninstalled or updated.
-            refresh((Bundle[]) toRefresh.toArray(new Bundle[toRefresh.size()]));
+            Set toRefresh = new HashSet();
+            toRefresh.addAll(uninstalledBundles);
+            toRefresh.addAll(updatedBundles);
+            toRefresh.addAll(installedBundles);
+            findBundlesWithFragmentsToRefresh(toRefresh);
+            findBundlesWithOptionalPackagesToRefresh(toRefresh);
+            if (toRefresh.size() > 0)
+            {
+                // Refresh if any bundle got uninstalled or updated.
+                refresh((Bundle[]) toRefresh.toArray(new Bundle[toRefresh.size()]));
+            }
         }
 
         if (startBundles)



Mime
View raw message