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

Mistake in JavaDocs 16 - MulticastSocket

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8, 11, 16, 17
    • core-libs

      A DESCRIPTION OF THE PROBLEM :
      The documentation for the MutlicastSocket says a DatagramPacket can be created like this:
       DatagramPacket hi = new DatagramPacket(msgBytes, msgBytes.length,
                                              group, 6789);
      But the DatagramPacket doesn't have a constructor like this.
      The code should be something like this:
      DatagramPacket hi = new DatagramPacket(msgBytes, msgBytes.length,
                                              group);

      A second but not mandatory improvment would be to replace the variable port with 6789, like it is done in all other lines.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Go to:
      https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/MulticastSocket.html#leaveGroup(java.net.SocketAddress,java.net.NetworkInterface)

      You should see it right at the top of see page in the guide.


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: