Skip to content

Commit ce7e249

Browse files
committed
Fix DependencyComputer missing bundles when they have different versions
Currently the DependencyComputer sorts only by bundle name (even though the comment for the code mentions the version as well) this can lead to the situation that if a bundle requires the same bundle in different versions (e.g. because it has actually different package names like javax -> jakarta) it only gets one of both on the classpath even though the P2 input suggests both. This simply enhances the used key in the mak with the version as already suggested by the java comment.
1 parent 234f4f9 commit ce7e249

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DependencyComputer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ public String getSymbolicName() {
119119
public Version getVersion() {
120120
return getRevision().getVersion();
121121
}
122+
123+
@Override
124+
public String toString() {
125+
return "DependencyEntry [module=" + module + ", rules=" + rules + "]";
126+
}
122127
}
123128

124129
private final class VisiblePackages {
@@ -182,7 +187,7 @@ public List<DependencyEntry> computeDependencies(ModuleRevision module) {
182187
// sort by symbolicName_version to get a consistent order
183188
Map<String, BundleRevision> resolvedImportPackages = new TreeMap<>();
184189
for (BundleRevision bundle : visiblePackages.getParticipatingModules()) {
185-
resolvedImportPackages.put(bundle.getSymbolicName(), bundle);
190+
resolvedImportPackages.put(bundle.getSymbolicName() + "_" + bundle.getVersion(), bundle);
186191
}
187192
for (BundleRevision bundle : resolvedImportPackages.values()) {
188193
addDependencyViaImportPackage(bundle, added, visiblePackages, entries);

0 commit comments

Comments
 (0)