--- old/src/java.base/share/classes/java/net/MulticastSocket.java 2020-01-14 19:13:43.000000000 +0000 +++ new/src/java.base/share/classes/java/net/MulticastSocket.java 2020-01-14 19:13:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ import java.util.Collections; import java.util.Enumeration; import java.util.Set; + /** * The multicast datagram socket class is useful for sending * and receiving IP multicast packets. A MulticastSocket is @@ -208,6 +209,10 @@ public MulticastSocket(SocketAddress bindaddr) throws IOException { super((SocketAddress) null); + // No further initialization when this is a DatagramChannel socket adaptor + if (this instanceof sun.nio.ch.DatagramSocketAdaptor) + return; + // Enable SO_REUSEADDR before binding setReuseAddress(true);