Skip to content
Permalink
Browse files

Clean-up merge witth JDK-8238231

  • Loading branch information
AlanBateman committed Feb 9, 2020
1 parent 3039e61 commit e934eb22e97088727a7bec72ce3219bd73f32d01
@@ -204,7 +204,7 @@ public DatagramSocket() throws SocketException {
* @since 1.4
*/
protected DatagramSocket(DatagramSocketImpl impl) {
this.delegate = new DatagramSocketImplWrapper(impl, /*created*/false); // throws NPE if null
this.delegate = new DatagramSocketImplWrapper(impl); // throws NPE if null
}

/**
@@ -1087,21 +1087,21 @@ private static DatagramSocket createDelegate(boolean multicast)
} else {
impl = DefaultDatagramSocketImplFactory.createDatagramSocketImpl(multicast);
}
impl.create(); // create socket
return new DatagramSocketImplWrapper(impl, /*created*/true);
DatagramSocketImplWrapper delegate = new DatagramSocketImplWrapper(impl);
delegate.getImpl(); // create UDP socket
return delegate;
} else {
// Return a DatagramChannel socket adaptor
DatagramSocket delegate;
try {
delegate = DefaultSelectorProvider.get()
return DefaultSelectorProvider.get()
.openUninterruptibleDatagramChannel()
.socket();
} catch (SocketException e) {
throw e;
} catch (IOException e) {
throw new SocketException(e.getMessage());
}
return delegate;
}

}
}
@@ -94,14 +94,11 @@
* to a DatagramSocketImpl.
*
* @param impl a new DatagramSocketImpl
* @param created true if the impl's socket has been created
* @throws NullPointerException if impl is null
*/
DatagramSocketImplWrapper(DatagramSocketImpl impl, boolean created) {
DatagramSocketImplWrapper(DatagramSocketImpl impl) {
super((MulticastSocket) null);
this.impl = Objects.requireNonNull(impl);
if (created)
this.created = true;
this.oldImpl = checkOldImpl(impl);
}

0 comments on commit e934eb2

Please sign in to comment.