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

Deprecate MulticastSocket methods that operate on java.net.InetAddress

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      The change causes the compiler to generate ordinary deprecation warnings for the methods in question. No usage of theses methods within the JDK.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Deprecate, not for removal, the following methods in java.net.MulticastSocket:

       1. MulticastSocket.getInterface()
       2. MulticastSocket.setInterface(InetAddress inf)
       3. MulticastSocket.joinGroup(InetAddress mcastaddr)
       4. MulticastSocket.leaveGroup(InetAddress mcastaddr)
       5. MulticastSocket.getLoopbackMode()
       6. MulticastSocket.setLoopbackMode(boolean disable)

      Problem

      Methods 1 - 4 operate on java.net.InetAddress instead of java.net.NetworkInterface and thus do not allow to pass or return the NetworkInterface set for a MulticastSocket. It is preferred to use NetworkInterface as an InetAddress may not uniquely identify a NetworkInterface.

      Methods 5 - 6 operate on SocketOptions.IP_MULTICAST_LOOP. However, MulticastSocket.setOption conforms with StandardSocketOptions.IP_MULTICAST_LOOP, which should be used instead.

      Solution

      Add the @Deprecated annotation and the @deprecated javadoc tag to the methods in question.

      Specification

      Webrev: http://cr.openjdk.java.net/~jboes/webrevs/8233319/webrev.01/

      Specdiff attached.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jboes Julia Boes
                Reporter:
                chegar Chris Hegarty
                Reviewed By:
                Alan Bateman, Chris Hegarty, Daniel Fuchs
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: