Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2016-12-07 18:19:59 +0000
committerStephan Herrmann2016-12-07 18:19:59 +0000
commit58108cfb9f801d033a645e2e11b44fc54bb241a8 (patch)
treea4c3fd891d48b11f0fc1683d2a8b10165759cdf1
parentadd14365471b6d553ef62251709016fbc5b5e3d9 (diff)
downloadorg.eclipse.objectteams-58108cfb9f801d033a645e2e11b44fc54bb241a8.tar.gz
org.eclipse.objectteams-58108cfb9f801d033a645e2e11b44fc54bb241a8.tar.xz
org.eclipse.objectteams-58108cfb9f801d033a645e2e11b44fc54bb241a8.zip
Bug 508852: [otre] Team causes ClassNotFoundException if roles bind to
different base plugins
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBinding.java15
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBindingRegistry.java12
2 files changed, 20 insertions, 7 deletions
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBinding.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBinding.java
index 81c5b2b33..164e67bdd 100644
--- a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBinding.java
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBinding.java
@@ -108,6 +108,15 @@ public class AspectBinding {
}
}
+ void connectEquivalent(TeamBinding equivalent) {
+ this.equivalenceSet.add(equivalent);
+ boolean locallyHaveBases = !this.baseClassNames.isEmpty();
+ if (!equivalent.baseClassNames.isEmpty())
+ this.baseClassNames.addAll(equivalent.baseClassNames);
+ if (locallyHaveBases)
+ equivalent.baseClassNames.addAll(this.baseClassNames);
+ }
+
@SuppressWarnings("unchecked")
public @Nullable Class<? extends Team> loadTeamClass() {
if (teamClass != null) return teamClass;
@@ -296,8 +305,10 @@ public class AspectBinding {
// do we have TeamBindings representing the same team class (from different aspect bindings)?
Set<TeamBinding> equivalenceSet = teamLookup.get(team.teamName);
- if (equivalenceSet != null)
- team.equivalenceSet.addAll(equivalenceSet);
+ if (equivalenceSet != null) {
+ for (TeamBinding equivalent : equivalenceSet)
+ team.connectEquivalent(equivalent); // TODO: nullness will be handled from Set<@NonNull TeamBinding>
+ }
if (team.equivalenceSet.size() > 1)
log(IStatus.INFO, "team "+team.teamName+" participates in "+team.equivalenceSet.size()+" aspect bindings.");
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBindingRegistry.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBindingRegistry.java
index 58c6ea880..a4d2d49f7 100644
--- a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBindingRegistry.java
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/AspectBindingRegistry.java
@@ -328,11 +328,13 @@ public class AspectBindingRegistry {
}
public BaseBundle getBaseBundle(String bundleName) {
- BaseBundle bundle = baseBundleLookup.get(bundleName);
- if (bundle == null) {
- bundle = new BaseBundle(bundleName);
- baseBundleLookup.put(bundleName, bundle);
+ synchronized (baseBundleLookup) {
+ BaseBundle bundle = baseBundleLookup.get(bundleName);
+ if (bundle == null) {
+ bundle = new BaseBundle(bundleName);
+ baseBundleLookup.put(bundleName, bundle);
+ }
+ return bundle;
}
- return bundle;
}
}

Back to the top