8023997: j.l.String.join(java.lang.CharSequence, java.lang.Iterable) sample doesn't compile and is incorrect
authorhenryjen
Tue, 03 Sep 2013 16:05:45 -0700
changeset 19802 d44eb5b1f125
parent 19801 97f3caac6c77
child 19803 db1de252632d
8023997: j.l.String.join(java.lang.CharSequence, java.lang.Iterable) sample doesn't compile and is incorrect Reviewed-by: alanb
jdk/src/share/classes/java/lang/String.java
--- a/jdk/src/share/classes/java/lang/String.java	Tue Sep 03 22:37:07 2013 +0100
+++ b/jdk/src/share/classes/java/lang/String.java	Tue Sep 03 16:05:45 2013 -0700
@@ -2457,8 +2457,8 @@
      *     String message = String.join(" ", strings);
      *     //message returned is: "Java is cool"
      *
-     *     Set<String> strings = new HashSet<>();
-     *     Strings.add("Java"); strings.add("is");
+     *     Set<String> strings = new LinkedHashSet<>();
+     *     strings.add("Java"); strings.add("is");
      *     strings.add("very"); strings.add("cool");
      *     String message = String.join("-", strings);
      *     //message returned is: "Java-is-very-cool"