8171374: GenGraphs should filter the rank grouping if the group is empty
authormchung
Fri, 16 Dec 2016 09:42:33 -0800
changeset 42708 b59eb84f0b0f
parent 42707 6059f74bacdf
child 42709 d477072ef0e4
8171374: GenGraphs should filter the rank grouping if the group is empty Reviewed-by: alanb, psandoz
jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
--- a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java	Fri Dec 16 17:20:37 2016 +0000
+++ b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java	Fri Dec 16 09:42:33 2016 -0800
@@ -214,13 +214,13 @@
 
             // same ranks
             ranks.stream()
-                .forEach(group -> out.format("{rank=same %s}%n",
-                    descriptors.stream()
-                        .map(ModuleDescriptor::name)
-                        .filter(group::contains)
-                        .map(mn -> "\"" + mn + "\"")
-                        .collect(joining(","))
-                ));
+                .map(group -> descriptors.stream()
+                                         .map(ModuleDescriptor::name)
+                                         .filter(group::contains)
+                                         .map(mn -> "\"" + mn + "\"")
+                                         .collect(joining(",")))
+                .filter(group -> group.length() > 0)
+                .forEach(group -> out.format("{rank=same %s}%n", group));
 
             descriptors.stream()
                 .filter(jdkGroup::contains)