Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
index 75d62d808..6563479a4 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
@@ -664,18 +664,20 @@ public abstract class StateImpl implements State {
BundleDescription[] getFragments(final BundleDescription host) {
final List<BundleDescription> fragments = new ArrayList<BundleDescription>();
- for (Iterator<KeyedElement> iter = bundleDescriptions.iterator(); iter.hasNext();) {
- BundleDescription bundle = (BundleDescription) iter.next();
- HostSpecification hostSpec = bundle.getHost();
-
- if (hostSpec != null) {
- BundleDescription[] hosts = hostSpec.getHosts();
- if (hosts != null)
- for (int i = 0; i < hosts.length; i++)
- if (hosts[i] == host) {
- fragments.add(bundle);
- break;
- }
+ synchronized (this.monitor) {
+ for (Iterator<KeyedElement> iter = bundleDescriptions.iterator(); iter.hasNext();) {
+ BundleDescription bundle = (BundleDescription) iter.next();
+ HostSpecification hostSpec = bundle.getHost();
+
+ if (hostSpec != null) {
+ BundleDescription[] hosts = hostSpec.getHosts();
+ if (hosts != null)
+ for (int i = 0; i < hosts.length; i++)
+ if (hosts[i] == host) {
+ fragments.add(bundle);
+ break;
+ }
+ }
}
}
return fragments.toArray(new BundleDescription[fragments.size()]);

Back to the top