8193256: Configuration and ModuleLayer findModule cleanup

Reviewed-by: redestad, alanb
This commit is contained in:
Andrej Golovnin 2017-12-08 14:28:51 +00:00 committed by Alan Bateman
parent a87551990a
commit 93aa3ae4d7
2 changed files with 4 additions and 6 deletions
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();
}