8171374: GenGraphs should filter the rank grouping if the group is empty
Reviewed-by: alanb, psandoz
--- 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)