Skip to content

Commit

Permalink
Solved a small logical error in the stop command:
Browse files Browse the repository at this point in the history
- only if the stopUnaffectedBundles isn't set, we can omit stopping
  bundles. If it *is* set, we should *always* stop all bundles.



git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1652840 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Jan Willem Janssen committed Jan 18, 2015
1 parent fe1c648 commit 47225a4
Showing 1 changed file with 8 additions and 6 deletions.
Expand Up @@ -88,17 +88,19 @@ protected void doExecute(DeploymentSessionImpl session) throws Exception {
* 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 {
Expand Down

0 comments on commit 47225a4

Please sign in to comment.