You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2010/01/26 17:08:28 UTC
svn commit: r903297 - in
/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver:
Main.java proto3/Proto3Resolver.java
Author: rickhall
Date: Tue Jan 26 16:08:28 2010
New Revision: 903297
URL: http://svn.apache.org/viewvc?rev=903297&view=rev
Log:
Uses constraints must be checked recursively.
Modified:
felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java
felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java
Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java?rev=903297&r1=903296&r2=903297&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java (original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java Tue Jan 26 16:08:28 2010
@@ -926,4 +926,35 @@
return target;
}
+
+ // SOLUTION:
+ // C: foo->B
+ // D: barrr->C, foo->B
+ private static Module scenario20(List<Module> moduleList)
+ {
+ Module m, target;
+
+ // Bundle A
+ moduleList.add(
+ (m = new Module("A"))
+ .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo").with("vendor=A")));
+ // Bundle B
+ moduleList.add(
+ (m = new Module("B"))
+ .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo").with("vendor=B")));
+ // Bundle C
+ moduleList.add(
+ (m = new Module("C"))
+ .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("foo"))
+ .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=barr").using("bar"))
+ .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=barrr").using("barr"))
+ .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foo").with("vendor=B")));
+ // Bundle D
+ moduleList.add(
+ target = (m = new Module("D"))
+ .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=barrr"))
+ .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foo")));
+
+ return target;
+ }
}
\ No newline at end of file
Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java?rev=903297&r1=903296&r2=903297&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java (original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java Tue Jan 26 16:08:28 2010
@@ -665,7 +665,7 @@
System.out.println("+++ MERGING CB " + candBlame + " SB " + candSourceBlame);
// usedCaps.add(new Blame(candBlame.m_reqs, sourceBlame.m_cap));
usedCaps.add(candSourceBlame);
- return;
+// return;
}
else if (!current.isResolved())
{
@@ -715,6 +715,9 @@
+ candSourceBlame);
}
}
+
+ verifyAndMergeUses(current, currentPkgs, candSourceBlame,
+ modulePkgMap, candidateMap, cycleMap);
}
}
}