If we are unable to reload a cached bundle, then we should delete the
entire cached bundle directory, not just the revision. (FELIX-2222)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@926467 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java b/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
index e9673d3..92a5be0 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
@@ -142,9 +142,10 @@
                 }
                 catch (Exception ex)
                 {
-                    // Log and ignore.
+                    // Log exception and remove bundle archive directory.
                     m_logger.log(Logger.LOG_ERROR,
-                        "Error creating archive.", ex);
+                        "Error reloading cached bundle, removing it: " + children[i], ex);
+                    deleteDirectoryTree(children[i]);
                 }
             }
         }