changeset 49529:c0bdb1b1ab4f

8200127: Replace collection.stream().forEach() with collection.forEach() Reviewed-by: alanb
author martin
date Thu, 05 Apr 2018 09:34:46 -0700
parents c1eb35eb5f38
children 8f2ceebdc673
files src/java.base/share/classes/java/lang/module/ModuleDescriptor.java src/java.base/share/classes/java/lang/reflect/Proxy.java src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java
diffstat 3 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java	Thu Apr 05 09:33:27 2018 -0700
+++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java	Thu Apr 05 09:34:46 2018 -0700
@@ -1742,7 +1742,7 @@
                 throw new IllegalArgumentException("Empty target set");
             if (strict) {
                 requirePackageName(e.source());
-                targets.stream().forEach(Checks::requireModuleName);
+                targets.forEach(Checks::requireModuleName);
             }
             return exports(e);
         }
@@ -1878,7 +1878,7 @@
                 throw new IllegalArgumentException("Empty target set");
             if (strict) {
                 requirePackageName(opens.source());
-                targets.stream().forEach(Checks::requireModuleName);
+                targets.forEach(Checks::requireModuleName);
             }
             return opens(opens);
         }
--- a/src/java.base/share/classes/java/lang/reflect/Proxy.java	Thu Apr 05 09:33:27 2018 -0700
+++ b/src/java.base/share/classes/java/lang/reflect/Proxy.java	Thu Apr 05 09:34:46 2018 -0700
@@ -593,8 +593,7 @@
                                   module.getName(), cn, loader);
             }
             if (isDebug("debug")) {
-                interfaces.stream()
-                          .forEach(c -> System.out.println(toDetails(c)));
+                interfaces.forEach(c -> System.out.println(toDetails(c)));
             }
         }
 
--- a/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java	Thu Apr 05 09:33:27 2018 -0700
+++ b/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java	Thu Apr 05 09:34:46 2018 -0700
@@ -193,11 +193,10 @@
          */
         public Graph<T> transpose() {
             Builder<T> builder = new Builder<>();
-            nodes.stream().forEach(builder::addNode);
+            nodes.forEach(builder::addNode);
             // reverse edges
             edges.keySet().forEach(u -> {
-                edges.get(u).stream()
-                    .forEach(v -> builder.addEdge(v, u));
+                edges.get(u).forEach(v -> builder.addEdge(v, u));
             });
             return builder.build();
         }
@@ -231,8 +230,8 @@
 
         public void printGraph(PrintStream out) {
             out.println("graph for " + nodes);
-            nodes.stream()
-                .forEach(u -> adjacentNodes(u).stream()
+            nodes
+                .forEach(u -> adjacentNodes(u)
                     .forEach(v -> out.format("  %s -> %s%n", u, v)));
         }
 
@@ -302,7 +301,7 @@
                 return;
             }
             visited.add(node);
-            graph.edges().get(node).stream()
+            graph.edges().get(node)
                 .forEach(x -> visit(x, visited, done));
             done.add(node);
             result.addLast(node);