[8u-dev] RFR: 8036979: Support java.net.SocketOption<> in java.net socket types
Chris Hegarty
chris.hegarty at oracle.com
Fri Apr 11 09:27:55 UTC 2014
This looks mainly good to me.
Just a few small comments (mainly on the use of reflection):
1) jdk/net/Sockets.java
You could use a SharedSecret to access the private methods in the
public java.net package, but reflection is ok too.
2) If you stick with reflection then if a lookup of any of the methods
fails, throws ReflectiveOperationException, then you should probably
throw InternalError as there is something badly wrong.
3) Would it make sense for the invoker static methods of
jdk.net.Sockets to throw UncheckedIOException(e) ??
-Chris.
On 10/04/14 18:13, Michael McMahon wrote:
> Hi,
>
> This is the webrev for the 8u20 version of the fix that was reviewed
> yesterday for 9.
>
> JDK
> ===
> http://cr.openjdk.java.net/~michaelm/8036979.8u20/jdk/01/webrev/
>
> Top repo
> =====
> http://cr.openjdk.java.net/~michaelm/8036979.8u20/top/01/webrev/
>
> The good news is that the change is almost the same as the JDK 9 version
> with the following differences:
>
> 1) The java.net public API changes are gone. The new public methods for 9
> in SocketImpl and DatagramSocketImpl are package private here.
>
> 2) A new package private class java.net.SocketsUtil acts as a bridge
> between
> the public API in jdk.net.Sockets and the implementation in java.net
>
> 3) jdk.net.Sockets uses reflection to access the methods of
> java.net.SocketsUtil
>
> 4) The test of the public java.net API is gone and the other test augmented
> with some additional tests for the standard socket options
>
> Thanks,
> Michael
More information about the net-dev
mailing list