changeset 42708:b59eb84f0b0f

8171374: GenGraphs should filter the rank grouping if the group is empty Reviewed-by: alanb, psandoz
author mchung
date Fri, 16 Dec 2016 09:42:33 -0800
parents 6059f74bacdf
children d477072ef0e4
files jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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)