Skip to content

Commit

Permalink
Move comments to proper position and improve
Browse files Browse the repository at this point in the history
  • Loading branch information
rfscholte committed Sep 16, 2023
1 parent 5c06f1b commit 605780b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ public String extract(Path path) throws IOException {
continue;
}

// Consider strategies how to handle duplicate modules by name
// For now, just ignore it
// in case of identical module names, first one wins
if (moduleDescriptor != null && moduleNameSources.putIfAbsent(moduleDescriptor.name(), source) == null) {
availableNamedModules.put(moduleDescriptor.name(), moduleDescriptor);

Expand Down Expand Up @@ -249,12 +248,15 @@ public String extract(Path path) throws IOException {
request.isIncludeStatic());
}

// in case of identical module names, first one wins
Set<String> collectedModules = new HashSet<>(requiredNamedModules.size());

for (Entry<T, JavaModuleDescriptor> entry : pathElements.entrySet()) {
if (entry.getValue() != null
&& requiredNamedModules.contains(entry.getValue().name())) {
// Consider strategies how to handle duplicate modules by name
// For now only add first on modulePath, just ignore others,
// This has effectively the same result as putting it on the modulePath, but might better help
// analyzing issues.
if (collectedModules.add(entry.getValue().name())) {
result.getModulepathElements()
.put(
Expand Down

0 comments on commit 605780b

Please sign in to comment.