8193454: ModuleDescriptor.{Requires,Exports,Open} toString should use toLowerCase(Local.ROOT)
authoralanb
Wed, 13 Dec 2017 15:32:36 +0000
changeset 48261 43edfde828ab
parent 48260 8ca86cfb126f
child 48262 daf3b49f4839
8193454: ModuleDescriptor.{Requires,Exports,Open} toString should use toLowerCase(Local.ROOT) Reviewed-by: alanb Contributed-by: andrej.golovnin@gmail.com
src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
--- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java	Wed Dec 06 15:51:06 2017 -0800
+++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java	Wed Dec 13 15:32:36 2017 +0000
@@ -39,6 +39,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
@@ -2603,7 +2604,8 @@
      * Returns a string containing the given set of modifiers and label.
      */
     private static <M> String toString(Set<M> mods, String what) {
-        return (Stream.concat(mods.stream().map(e -> e.toString().toLowerCase()),
+        return (Stream.concat(mods.stream().map(e -> e.toString()
+                                                      .toLowerCase(Locale.ROOT)),
                               Stream.of(what)))
                 .collect(Collectors.joining(" "));
     }