RFR 8148609: supportedOptions() methods return a mutable set
Chris Hegarty
chris.hegarty at oracle.com
Tue Mar 1 09:50:49 UTC 2016
On 1 Mar 2016, at 09:45, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> On 01/03/2016 09:27, vyom wrote:
>> Hi All,
>>
>> Please review my code changes for the below issue.
>>
>> Bug: JDK-8148609 : supportedOptions() methods return a mutable set
>> Webrev: http://cr.openjdk.java.net/~nkumar/vyom/8148609/webrev0.0/ <http://cr.openjdk.java.net/%7Enkumar/vyom/8148609/webrev0.0/>
> Can we create the unmodified sets in the initializer instead?
Right, and the new Set.of(…) can do that much cleaner, and possibly
more efficient in the future …
private static final Set<SocketOption<?>> mcSocketOptions;
static {
mcSocketOptions = Set.of(StandardSocketOptions.SO_SNDBUF,
StandardSocketOptions.SO_RCVBUF,
StandardSocketOptions.SO_REUSEADDR,
StandardSocketOptions.IP_TOS);
}
-Chris.
More information about the net-dev
mailing list