Need to fire UNRESOLVED event when bundles are refreshed if they
are not in the INSTALLED state. (FELIX-2456)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1043207 13f79535-47bb-0310-9956-ffa450edef68
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 37e378c..fd544fc 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -3672,8 +3672,17 @@
 
         try
         {
-            // Reset the bundle object and fire UNRESOLVED event.
+            // See if we need to fire UNRESOLVED event.
+            boolean fire = (bundle.getState() != Bundle.INSTALLED);
+            // Reset the bundle object.
             ((BundleImpl) bundle).refresh();
+            // Fire UNRESOLVED event if necessary
+            // and notify state change..
+            if (fire)
+            {
+                setBundleStateAndNotify(bundle, Bundle.INSTALLED);
+                fireBundleEvent(BundleEvent.UNRESOLVED, bundle);
+            }
         }
         catch (Exception ex)
         {