Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Clean-up merge witth JDK-8238231
- Loading branch information
|
@@ -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); |
|
|
} |
|
|
|
|
|