felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r306809 - /incubator/felix/trunk/framework/src/org/apache/felix/framework/Felix.java
Date Thu, 06 Oct 2005 17:03:08 GMT
Author: rickhall
Date: Thu Oct  6 10:03:05 2005
New Revision: 306809

URL: http://svn.apache.org/viewcvs?rev=306809&view=rev
Log:
Fix a bug in populateImportGraph() that would infinite loop in
the presence of a cycle.

Modified:
    incubator/felix/trunk/framework/src/org/apache/felix/framework/Felix.java

Modified: incubator/felix/trunk/framework/src/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/framework/src/org/apache/felix/framework/Felix.java?rev=306809&r1=306808&r2=306809&view=diff
==============================================================================
--- incubator/felix/trunk/framework/src/org/apache/felix/framework/Felix.java (original)
+++ incubator/felix/trunk/framework/src/org/apache/felix/framework/Felix.java Thu Oct  6 10:03:05
2005
@@ -2638,11 +2638,15 @@
                 (importers != null) && (impIdx < importers.length);
                 impIdx++)
             {
+                // Avoid cycles if the bundle is already in map.
+                if (!map.containsKey(importers[impIdx]))
+                {
                     // Add each importing bundle to map.
                     map.put(importers[impIdx], importers[impIdx]);
                     // Now recurse into each bundle to get its importers.
                     populateImportGraph(
                         (BundleImpl) importers[impIdx], map);
+                }
             }
         }
     }



Mime
View raw message