< prev index next >
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
Print this page
rev 3356 : [mq]: 8140281-deprecation-optional.get
@@ -293,12 +293,11 @@
Set<String> serviceNames = jf.stream()
.map(e -> e.getName())
.filter(e -> e.startsWith(SERVICES_PREFIX))
.distinct()
.map(this::toServiceName)
- .filter(Optional::isPresent)
- .map(Optional::get)
+ .flatMap(Optional::stream)
.collect(Collectors.toSet());
// parse each service configuration file
for (String sn : serviceNames) {
JarEntry entry = jf.getJarEntry(SERVICES_PREFIX + sn);
< prev index next >