felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r728287 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
Date Sat, 20 Dec 2008 15:03:00 GMT
Author: rickhall
Date: Sat Dec 20 07:02:59 2008
New Revision: 728287

URL: http://svn.apache.org/viewvc?rev=728287&view=rev
Log:
We cannot call stop() on fragments, so make sure the bundle is active
before stopping it. (FELIX-820)

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?rev=728287&r1=728286&r2=728287&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Sat Dec 20 07:02:59
2008
@@ -1188,7 +1188,7 @@
                     }
                 }
                 // Stop the bundle if necessary.
-                else if ((impl.getInfo().getPersistentState() == Bundle.ACTIVE) &&
+                else if ((impl.getInfo().getState() == Bundle.ACTIVE) &&
                     (impl.getInfo().getStartLevel(getInitialBundleStartLevel())
                         > m_activeStartLevel))
                 {
@@ -1327,8 +1327,9 @@
                         startBundle(impl, false);
                     }
                     // Stop the bundle if necessary.
-                    else if (impl.getInfo().getStartLevel(getInitialBundleStartLevel())
-                        > m_activeStartLevel)
+                    else if ((impl.getInfo().getState() == Bundle.ACTIVE) &&
+                        (impl.getInfo().getStartLevel(getInitialBundleStartLevel())
+                        > m_activeStartLevel))
                     {
                         stopBundle(impl, false);
                     }
@@ -2173,13 +2174,16 @@
         // The spec says that uninstall should always succeed, so
         // catch an exception here if stop() doesn't succeed and
         // rethrow it at the end.
-        try
+        if (info.getState() == Bundle.ACTIVE)
         {
-            stopBundle(bundle, true);
-        }
-        catch (BundleException ex)
-        {
-            fireFrameworkEvent(FrameworkEvent.ERROR, bundle, ex);
+            try
+            {
+                stopBundle(bundle, true);
+            }
+            catch (BundleException ex)
+            {
+                fireFrameworkEvent(FrameworkEvent.ERROR, bundle, ex);
+            }
         }
 
         // Remove the bundle from the installed map.



Mime
View raw message