Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8023997

j.l.String.join(java.lang.CharSequence, java.lang.Iterable) sample doesn't compile and is incorrect

    XMLWordPrintable

Details

    • 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





      Attachments

        Activity

          People

            henryjen Henry Jen
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: