diff options
author | Thomas Watson | 2012-10-26 13:27:13 +0000 |
---|---|---|
committer | Thomas Watson | 2012-10-26 13:27:13 +0000 |
commit | 7d9580eb4c4448d1ac54e4ecb3ce952b76840489 (patch) | |
tree | 22fb515ea9b2e968ba2d762ddf5225b15b668446 | |
parent | 8331354005f7136f31a7e545bb6962fcf83743ea (diff) | |
download | rt.equinox.framework-7d9580eb4c4448d1ac54e4ecb3ce952b76840489.tar.gz rt.equinox.framework-7d9580eb4c4448d1ac54e4ecb3ce952b76840489.tar.xz rt.equinox.framework-7d9580eb4c4448d1ac54e4ecb3ce952b76840489.zip |
Bug 392874 - NPE from KeyedHashSet$EquinoxSetIterator.hasNext v20121026-132713I20121106-0800I20121031-2000I20121031-0800I20121030-2000I20121030-0800I20121029-2000I20121029-0800I20121028-2000
-rw-r--r-- | bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java | 26 |
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()]); |