8193256: Configuration and ModuleLayer findModule cleanup
Reviewed-by: redestad, alanb
This commit is contained in:
parent
a87551990a
commit
93aa3ae4d7
src/java.base/share/classes/java/lang
@ -845,9 +845,8 @@ public final class ModuleLayer {
|
||||
|
||||
return layers()
|
||||
.skip(1) // skip this layer
|
||||
.map(l -> l.nameToModule)
|
||||
.filter(map -> map.containsKey(name))
|
||||
.map(map -> map.get(name))
|
||||
.map(l -> l.nameToModule.get(name))
|
||||
.filter(Objects::nonNull)
|
||||
.findAny();
|
||||
}
|
||||
|
||||
|
@ -543,9 +543,8 @@ public final class Configuration {
|
||||
if (!parents.isEmpty()) {
|
||||
return configurations()
|
||||
.skip(1) // skip this configuration
|
||||
.map(cf -> cf.nameToModule)
|
||||
.filter(map -> map.containsKey(name))
|
||||
.map(map -> map.get(name))
|
||||
.map(cf -> cf.nameToModule.get(name))
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user