You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ja...@apache.org on 2015/01/18 20:54:17 UTC

svn commit: r1652840 - /felix/trunk/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/StopBundleCommand.java

Author: jawi
Date: Sun Jan 18 19:54:17 2015
New Revision: 1652840

URL: http://svn.apache.org/r1652840
Log:
Solved a small logical error in the stop command:

- only if the stopUnaffectedBundles isn't set, we can omit stopping
  bundles. If it *is* set, we should *always* stop all bundles.


Modified:
    felix/trunk/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/StopBundleCommand.java

Modified: felix/trunk/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/StopBundleCommand.java
URL: http://svn.apache.org/viewvc/felix/trunk/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/StopBundleCommand.java?rev=1652840&r1=1652839&r2=1652840&view=diff
==============================================================================
--- felix/trunk/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/StopBundleCommand.java (original)
+++ felix/trunk/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/StopBundleCommand.java Sun Jan 18 19:54:17 2015
@@ -88,17 +88,19 @@ public class StopBundleCommand extends C
      *         deployment package. Returns <code>false</code> otherwise.
      */
     private boolean omitBundleStop(DeploymentSessionImpl session, String symbolicName) {
-        boolean stopUnaffectedBundle = session.getConfiguration().isStopUnaffectedBundles();
+        boolean stopUnaffectedBundles = session.getConfiguration().isStopUnaffectedBundles();
+        if (stopUnaffectedBundles) {
+            // Default behavior: stop all bundles (see spec)... 
+            return false;
+        }
 
-        boolean result = stopUnaffectedBundle;
         BundleInfoImpl sourceBundleInfo = session.getSourceAbstractDeploymentPackage().getBundleInfoByName(symbolicName);
         BundleInfoImpl targetBundleInfo = session.getTargetAbstractDeploymentPackage().getBundleInfoByName(symbolicName);
+        
         boolean fixPackageMissing = sourceBundleInfo != null && sourceBundleInfo.isMissing();
         boolean sameVersion = (targetBundleInfo != null && sourceBundleInfo != null && targetBundleInfo.getVersion().equals(sourceBundleInfo.getVersion()));
-        if (fixPackageMissing || sameVersion) {
-            result = true;
-        }
-        return result;
+
+        return (fixPackageMissing || sameVersion);
     }
 
     private static class StartBundleRunnable extends AbstractAction {