# HG changeset patch # User henryjen # Date 1378249545 25200 # Node ID d44eb5b1f1256cb8ca7edaaa11095b7654da84d1 # Parent 97f3caac6c77dd5bfa21c863545bb97ffd90ce7f 8023997: j.l.String.join(java.lang.CharSequence, java.lang.Iterable) sample doesn't compile and is incorrect Reviewed-by: alanb diff -r 97f3caac6c77 -r d44eb5b1f125 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 strings = new HashSet<>(); - * Strings.add("Java"); strings.add("is"); + * Set 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"