Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Lippert2009-05-18 08:03:57 +0000
committerMartin Lippert2009-05-18 08:03:57 +0000
commitb4f2228b0e8a39865a24e27ff4427f94477fb988 (patch)
treeb0bd46d9f37ee929e1b2220d2a611836d3618347 /bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java
parent3c057a2734ad9f10cf1bfa1177f763b59b151f18 (diff)
downloadrt.equinox.bundles-b4f2228b0e8a39865a24e27ff4427f94477fb988.tar.gz
rt.equinox.bundles-b4f2228b0e8a39865a24e27ff4427f94477fb988.tar.xz
rt.equinox.bundles-b4f2228b0e8a39865a24e27ff4427f94477fb988.zip
Bug 272428 - [aspects] Hangs after Scala plugin update; after force quit and manual restart, it crashes; after second manual restart, it finally runs.
Diffstat (limited to 'bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java')
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java29
1 files changed, 22 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java
index d37a0f973..d089a11dd 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java
@@ -238,6 +238,13 @@ public class SupplementerRegistry implements ISupplementerRegistry {
*/
public void refreshBundles(final Bundle[] bundles) {
if (this.packageAdmin != null) {
+ if (AbstractWeavingHook.verbose) {
+ for (int i = 0; i < bundles.length; i++) {
+ System.out.println("refresh bundle: "
+ + bundles[i].getSymbolicName());
+ }
+ }
+
this.packageAdmin.refreshPackages(bundles);
}
}
@@ -250,6 +257,8 @@ public class SupplementerRegistry implements ISupplementerRegistry {
removeSupplementedBundle(bundle);
this.supplementersByBundle.remove(bundle.getBundleId());
+ this.adaptorProvider.resetAdaptor(bundle.getBundleId());
+
// if this bundle supplements other bundles, remove this supplementer and update the other bundles
if (supplementers.containsKey(bundle.getSymbolicName())) {
@@ -266,7 +275,19 @@ public class SupplementerRegistry implements ISupplementerRegistry {
final Bundle[] supplementedBundles = supplementer
.getSupplementedBundles();
if (supplementedBundles != null && supplementedBundles.length > 0) {
- refreshBundles(supplementedBundles);
+ final List<Bundle> bundlesToRefresh = new ArrayList<Bundle>(
+ supplementedBundles.length);
+ for (final Bundle bundleToRefresh : supplementedBundles) {
+ if (this.adaptorProvider.getAdaptor(bundleToRefresh
+ .getBundleId()) != null) {
+ bundlesToRefresh.add(bundleToRefresh);
+ }
+ }
+
+ if (bundlesToRefresh.size() > 0) {
+ refreshBundles(bundlesToRefresh
+ .toArray(new Bundle[bundlesToRefresh.size()]));
+ }
}
// remove this supplementer from the list of supplementers per other bundle
@@ -391,12 +412,6 @@ public class SupplementerRegistry implements ISupplementerRegistry {
final Bundle[] bundles = bundlesToRefresh
.toArray(new Bundle[bundlesToRefresh.size()]);
- if (AbstractWeavingHook.verbose) {
- for (int i = 0; i < bundles.length; i++) {
- System.out.println("refresh bundle: "
- + bundles[i].getSymbolicName());
- }
- }
refreshBundles(bundles);
}
}

Back to the top