Skip to content

Commit

Permalink
If there are duplicate packages use the first declaration
Browse files Browse the repository at this point in the history
In some rare cases it can happen that duplicate exports are present
(seen in org.eclipse.osgi with java.io package resolved from jre), in
this case API tools fails with an error.

THis now simply always ever use the first declared package for analysis.
  • Loading branch information
laeubi committed Jan 14, 2025
1 parent b8f34f6 commit 493bedf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2301,10 +2301,10 @@ private void checkApiComponentPackageVersions(BundleComponent referenceBundle, B
IDelta[] breakingChanges, IDelta[] compatibleChanges) throws CoreException {
Map<String, ExportPackageDescription> referencePackages = Arrays
.stream(referenceBundle.getBundleDescription().getExportPackages())
.collect(Collectors.toMap(ExportPackageDescription::getName, Function.identity()));
.collect(Collectors.toMap(ExportPackageDescription::getName, Function.identity(), (a, b) -> a));
Map<String, ExportPackageDescription> componentPackages = Arrays
.stream(componentBundle.getBundleDescription().getExportPackages())
.collect(Collectors.toMap(ExportPackageDescription::getName, Function.identity()));
.collect(Collectors.toMap(ExportPackageDescription::getName, Function.identity(), (a, b) -> a));
// a mapping between a package name and a required change
Map<String, RequiredPackageVersionChange> requiredChanges = new HashMap<>();
// we must compare compatible changes first, so these where overwritten later by
Expand Down

0 comments on commit 493bedf

Please sign in to comment.