mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8235783: DatagramSocket::disconnect should allow an implementation to throw UncheckedIOException
Undocumented throwing of Errors changed to throw a more user friendly UncheckedIOException Reviewed-by: alanb, chegar, dfuchs
This commit is contained in:
parent
4eacb6361b
commit
94bb505c94
2 changed files with 33 additions and 10 deletions
|
@ -26,6 +26,7 @@
|
|||
package sun.nio.ch;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodHandles.Lookup;
|
||||
|
@ -116,7 +117,7 @@ public class DatagramSocketAdaptor
|
|||
try {
|
||||
connectInternal(new InetSocketAddress(address, port));
|
||||
} catch (SocketException x) {
|
||||
throw new Error(x);
|
||||
throw new UncheckedIOException(x);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +133,7 @@ public class DatagramSocketAdaptor
|
|||
try {
|
||||
dc.disconnect();
|
||||
} catch (IOException x) {
|
||||
throw new Error(x);
|
||||
throw new UncheckedIOException(x);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue