Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2010-04-02 12:07:09 -0400
committerThomas Watson2010-04-02 12:07:09 -0400
commit0600072aabc6267c58631637ac8efb9585cb1971 (patch)
tree7bc15972c934fb67b6eaa530f440e34fc7f54851 /bundles/org.eclipse.osgi
parent45fad02a992a4e0f6e6eae32a7a177b82da74878 (diff)
downloadrt.equinox.framework-0600072aabc6267c58631637ac8efb9585cb1971.tar.gz
rt.equinox.framework-0600072aabc6267c58631637ac8efb9585cb1971.tar.xz
rt.equinox.framework-0600072aabc6267c58631637ac8efb9585cb1971.zip
Bug 300820 - Failure in testBug289719 on I20100125-0800 build
Diffstat (limited to 'bundles/org.eclipse.osgi')
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java
index 5ecc3e39a..64425f045 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/StartLevelManager.java
@@ -356,7 +356,7 @@ public class StartLevelManager implements EventDispatcher, EventListener, StartL
* <tt>AdminPermission</tt> and the Java runtime environment supports
* permissions.
*/
- public void setBundleStartLevel(org.osgi.framework.Bundle bundle, int newSL) {
+ public void setBundleStartLevel(Bundle bundle, int newSL) {
String exceptionText = null;
if (bundle.getBundleId() == 0) { // system bundle has id=0
@@ -372,7 +372,8 @@ public class StartLevelManager implements EventDispatcher, EventListener, StartL
framework.checkAdminPermission(bundle, AdminPermission.EXECUTE);
try {
// if the bundle's startlevel is not already at the requested startlevel
- if (newSL != ((org.eclipse.osgi.framework.internal.core.AbstractBundle) bundle).getStartLevel()) {
+ int oldSL = ((AbstractBundle) bundle).getStartLevel();
+ if (newSL != oldSL) {
final AbstractBundle b = (AbstractBundle) bundle;
b.getBundleData().setStartLevel(newSL);
try {
@@ -389,7 +390,9 @@ public class StartLevelManager implements EventDispatcher, EventListener, StartL
throw (RuntimeException) e.getException();
}
// handle starting or stopping the bundle asynchronously
- issueEvent(new StartLevelEvent(StartLevelEvent.CHANGE_BUNDLE_SL, newSL, (AbstractBundle) bundle));
+ if (newSL > oldSL || !((AbstractBundle) bundle).isActive())
+ // only need to do this if the newSL > oldSL (stopping) or the bundle is not active (could activate)
+ issueEvent(new StartLevelEvent(StartLevelEvent.CHANGE_BUNDLE_SL, newSL, (AbstractBundle) bundle));
}
} catch (IOException e) {
framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e);

Back to the top