Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-11-21 18:21:32 -0500
committerThomas Watson2008-11-21 18:21:32 -0500
commit4506f36e69b2ad582778e7e5a4d412cd264e88dd (patch)
tree4901e46804084475faf16a28f06834416ca719be /bundles/org.eclipse.osgi/resolver
parentbb2dd2ada69075c405a92cc5f4b856d5d53fa584 (diff)
downloadrt.equinox.framework-4506f36e69b2ad582778e7e5a4d412cd264e88dd.tar.gz
rt.equinox.framework-4506f36e69b2ad582778e7e5a4d412cd264e88dd.tar.xz
rt.equinox.framework-4506f36e69b2ad582778e7e5a4d412cd264e88dd.zip
Bug 247522 StateImpl access bundleDescriptions field in unsafe manner
Diffstat (limited to 'bundles/org.eclipse.osgi/resolver')
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java17
1 files changed, 9 insertions, 8 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 11c9a12af..a017142e9 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
@@ -288,7 +288,7 @@ public abstract class StateImpl implements State {
resolveBundle(bundle, status, hosts, selectedExports, null, resolvedRequires, resolvedImports);
}
- public synchronized void resolveBundle(BundleDescription bundle, boolean status, BundleDescription[] hosts, ExportPackageDescription[] selectedExports, ExportPackageDescription[] substitutedExports, BundleDescription[] resolvedRequires, ExportPackageDescription[] resolvedImports) {
+ public void resolveBundle(BundleDescription bundle, boolean status, BundleDescription[] hosts, ExportPackageDescription[] selectedExports, ExportPackageDescription[] substitutedExports, BundleDescription[] resolvedRequires, ExportPackageDescription[] resolvedImports) {
synchronized (this.monitor) {
if (!resolving)
throw new IllegalStateException(); // TODO need error message here!
@@ -802,16 +802,16 @@ public abstract class StateImpl implements State {
}
}
- public synchronized ExportPackageDescription linkDynamicImport(BundleDescription importingBundle, String requestedPackage) {
+ public ExportPackageDescription linkDynamicImport(BundleDescription importingBundle, String requestedPackage) {
if (resolver == null)
throw new IllegalStateException("no resolver set"); //$NON-NLS-1$
BundleDescriptionImpl importer = (BundleDescriptionImpl) importingBundle;
if (importer.getDynamicStamp(requestedPackage) == getTimeStamp())
return null;
- try {
- resolving = true;
- fullyLoad();
- synchronized (this.monitor) {
+ fullyLoad();
+ synchronized (this.monitor) {
+ try {
+ resolving = true;
// ask the resolver to resolve our dynamic import
ExportPackageDescriptionImpl result = (ExportPackageDescriptionImpl) resolver.resolveDynamicImport(importingBundle, requestedPackage);
if (result == null)
@@ -823,10 +823,11 @@ public abstract class StateImpl implements State {
}
setDynamicCacheChanged(true);
return result;
+ } finally {
+ resolving = false;
}
- } finally {
- resolving = false;
}
+
}
void setReader(StateReader reader) {

Back to the top