Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.osgi/felix')
-rwxr-xr-xbundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/Candidates.java46
-rwxr-xr-xbundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/ShadowList.java17
2 files changed, 29 insertions, 34 deletions
diff --git a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/Candidates.java b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/Candidates.java
index 1afed36c3..29b2b7b10 100755
--- a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/Candidates.java
+++ b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/Candidates.java
@@ -834,6 +834,30 @@ class Candidates
}
// Step 4
+ // First copy candidates for wrapped requirements to the host.
+ for (WrappedResource hostResource : hostResources) {
+ for (Requirement r : hostResource.getRequirements(null))
+ {
+ Requirement origReq = ((WrappedRequirement) r).getDeclaredRequirement();
+ CandidateSelector cands = m_candidateMap.get(origReq);
+ if (cands != null)
+ {
+ if (cands instanceof ShadowList)
+ {
+ m_candidateMap.put(r, ShadowList.deepCopy((ShadowList) cands));
+ } else {
+ m_candidateMap.put(r, cands.copy());
+ }
+ for (Capability cand : cands.getRemainingCandidates())
+ {
+ Set<Requirement> dependents = m_dependentMap.get(cand);
+ dependents.remove(origReq);
+ dependents.add(r);
+ }
+ }
+ }
+ }
+
for (WrappedResource hostResource : hostResources)
{
// Replaces capabilities from fragments with the capabilities
@@ -918,28 +942,6 @@ class Candidates
}
}
}
-
- // Copy candidates for fragment requirements to the host.
- for (Requirement r : hostResource.getRequirements(null))
- {
- Requirement origReq = ((WrappedRequirement) r).getDeclaredRequirement();
- CandidateSelector cands = m_candidateMap.get(origReq);
- if (cands != null)
- {
- if (cands instanceof ShadowList)
- {
- m_candidateMap.put(r, ShadowList.deepCopy((ShadowList) cands));
- } else {
- m_candidateMap.put(r, cands.copy());
- }
- for (Capability cand : cands.getRemainingCandidates())
- {
- Set<Requirement> dependents = m_dependentMap.get(cand);
- dependents.remove(origReq);
- dependents.add(r);
- }
- }
- }
}
// Lastly, verify that all mandatory revisions are still
diff --git a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/ShadowList.java b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/ShadowList.java
index f69025fdc..a91ba30ee 100755
--- a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/ShadowList.java
+++ b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/ShadowList.java
@@ -27,36 +27,29 @@ import org.osgi.service.resolver.ResolveContext;
public class ShadowList extends CandidateSelector
{
- public static ShadowList createShadowList(CandidateSelector original) {
+ public static ShadowList createShadowList(CandidateSelector original) {
if (original instanceof ShadowList)
{
throw new IllegalArgumentException("Cannot create a ShadowList using another ShadowList.");
}
- return new ShadowList(original);
+ return new ShadowList(original.unmodifiable, original.unmodifiable, original.isUnmodifiable);
}
public static ShadowList deepCopy(ShadowList original) {
- List<Capability> originalCopy = new ArrayList<Capability>(original.m_original);
- return new ShadowList(original.unmodifiable, originalCopy, original.isUnmodifiable);
+ return new ShadowList(original.unmodifiable, original.m_original, original.isUnmodifiable);
}
private final List<Capability> m_original;
- private ShadowList(CandidateSelector original)
- {
- super(original);
- m_original = new ArrayList<Capability>(original.getRemainingCandidates());
- }
-
private ShadowList(CandidateSelector shadow, List<Capability> original)
{
super(shadow);
m_original = original;
}
- public ShadowList(List<Capability> unmodifiable, List<Capability> originalCopy, AtomicBoolean isUnmodifiable) {
+ private ShadowList(List<Capability> unmodifiable, List<Capability> original, AtomicBoolean isUnmodifiable) {
super(unmodifiable, isUnmodifiable);
- m_original = originalCopy;
+ m_original = new ArrayList<Capability>(original);
}
public ShadowList copy() {

Back to the top