RFR(XS): 8166584: Remove obsolete utility function NET_ThrowSocketException in windows libnet
Chris Hegarty
chris.hegarty at oracle.com
Mon Sep 26 14:50:48 UTC 2016
Christoph,
On 22/09/16 21:59, Langer, Christoph wrote:
> Hi,
>
> while looking at utility functions for creating exceptions in
> libjava/libnet I found a small spot that should be consolidated right away.
>
>
> The function NET_ThrowSocketException does only exist in the windows
> native implementation and is only used in 3 places in
> SocketInputStream.c. I removed this in favor of directly calling
> JNU_ThrowByName as the Unix variant of that code already does.
>
>
> In that function Java_java_net_SocketInputStream_socketRead0 I also
> replaced throwing a SocketException with throwing an NPE in the rare
> case that a the JNI input for the file descriptor is null. That’s
> probably more natural and should virtually never occur anyways.
Hmmm... I'm not sure about this. SocketException is thrown on
unix too for a similar situation. More significantly, a null value
represents that the socket has been, possibly asynchronously,
closed.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8166584
>
> Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8166584.0/
Other than the above concern, the remainder of the code looks ok
to me.
-Chris.
More information about the net-dev
mailing list