File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
plexus-java/src/main/java/org/codehaus/plexus/languages/java/jpms Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -188,8 +188,7 @@ public String extract(Path path) throws IOException {
188
188
continue ;
189
189
}
190
190
191
- // Consider strategies how to handle duplicate modules by name
192
- // For now, just ignore it
191
+ // in case of identical module names, first one wins
193
192
if (moduleDescriptor != null && moduleNameSources .putIfAbsent (moduleDescriptor .name (), source ) == null ) {
194
193
availableNamedModules .put (moduleDescriptor .name (), moduleDescriptor );
195
194
@@ -249,12 +248,15 @@ public String extract(Path path) throws IOException {
249
248
request .isIncludeStatic ());
250
249
}
251
250
252
- // in case of identical module names, first one wins
253
251
Set <String > collectedModules = new HashSet <>(requiredNamedModules .size ());
254
252
255
253
for (Entry <T , JavaModuleDescriptor > entry : pathElements .entrySet ()) {
256
254
if (entry .getValue () != null
257
255
&& requiredNamedModules .contains (entry .getValue ().name ())) {
256
+ // Consider strategies how to handle duplicate modules by name
257
+ // For now only add first on modulePath, just ignore others,
258
+ // This has effectively the same result as putting it on the modulePath, but might better help
259
+ // analyzing issues.
258
260
if (collectedModules .add (entry .getValue ().name ())) {
259
261
result .getModulepathElements ()
260
262
.put (
You can’t perform that action at this time.
0 commit comments