Details
-
Bug
-
Resolution: Fixed
-
P2
-
None
-
b108
-
Verified
Description
JDK8 b104:
http://download.java.net/jdk8/docs/api/java/lang/String.html#join%28java.lang.CharSequence,%20java.lang.Iterable%29
Normative part of the spec contains usage sample:
Set<String> strings = new HashSet<>();
Strings.add("Java"); strings.add("is");
strings.add("very"); strings.add("cool");
String message = String.join("-", strings);
//message returned is: "Java-is-very-cool"
1) It doesn't compile
2) HashSet doesn't guarantee order of iteration
http://download.java.net/jdk8/docs/api/java/lang/String.html#join%28java.lang.CharSequence,%20java.lang.Iterable%29
Normative part of the spec contains usage sample:
Set<String> strings = new HashSet<>();
Strings.add("Java"); strings.add("is");
strings.add("very"); strings.add("cool");
String message = String.join("-", strings);
//message returned is: "Java-is-very-cool"
1) It doesn't compile
2) HashSet doesn't guarantee order of iteration