Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2011-03-03 20:21:52 +0000
committerThomas Watson2011-03-03 20:21:52 +0000
commit56c0d398d74165f0d5b8e674f7c81cf02d916a38 (patch)
tree78e60839842c84d8babc243c38d06dbe9d9d37ec /bundles/org.eclipse.osgi/resolver
parentc1b9a2afd553e0b7502775008cb1919ad043d557 (diff)
downloadrt.equinox.framework-56c0d398d74165f0d5b8e674f7c81cf02d916a38.tar.gz
rt.equinox.framework-56c0d398d74165f0d5b8e674f7c81cf02d916a38.tar.xz
rt.equinox.framework-56c0d398d74165f0d5b8e674f7c81cf02d916a38.zip
Bug 338240 - Unsatisfied constraint for ACTIVE bundle
Diffstat (limited to 'bundles/org.eclipse.osgi/resolver')
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
index 5f57914c9..df09e9a75 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
@@ -190,7 +190,7 @@ public final class StateHelperImpl implements StateHelper {
State containingState = bundle.getContainingState();
if (containingState == null)
// it is a bug in the client to call this method when not attached to a state
- throw new IllegalStateException("Does not belong to a state"); //$NON-NLS-1$
+ throw new IllegalStateException("Does not belong to a state"); //$NON-NLS-1$
List<VersionConstraint> unsatisfied = new ArrayList<VersionConstraint>();
HostSpecification host = bundle.getHost();
if (host != null)
@@ -202,8 +202,16 @@ public final class StateHelperImpl implements StateHelper {
unsatisfied.add(requiredBundles[i]);
ImportPackageSpecification[] packages = bundle.getImportPackages();
for (int i = 0; i < packages.length; i++)
- if (!packages[i].isResolved() && !isResolvable(packages[i], hook))
+ if (!packages[i].isResolved() && !isResolvable(packages[i], hook)) {
+ if (bundle.isResolved()) {
+ // if the bundle is resolved the check if the import is option.
+ // Here we assume that an unresolved mandatory import must have been dropped
+ // in favor of an export from the same bundle (bug 338240)
+ if (!ImportPackageSpecification.RESOLUTION_OPTIONAL.equals(packages[i].getDirective(Constants.RESOLUTION_DIRECTIVE)))
+ continue;
+ }
unsatisfied.add(packages[i]);
+ }
GenericSpecification[] generics = bundle.getGenericRequires();
for (int i = 0; i < generics.length; i++)
if (!generics[i].isResolved() && !isResolvable(generics[i], hook))

Back to the top