Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2012-10-26 09:27:13 -0400
committerThomas Watson2012-10-26 09:27:13 -0400
commit7d9580eb4c4448d1ac54e4ecb3ce952b76840489 (patch)
tree22fb515ea9b2e968ba2d762ddf5225b15b668446
parent8331354005f7136f31a7e545bb6962fcf83743ea (diff)
downloadrt.equinox.framework-7d9580eb4c4448d1ac54e4ecb3ce952b76840489.tar.gz
rt.equinox.framework-7d9580eb4c4448d1ac54e4ecb3ce952b76840489.tar.xz
rt.equinox.framework-7d9580eb4c4448d1ac54e4ecb3ce952b76840489.zip
-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