On 1 Mar 2016, at 09:45, Alan Bateman <alan.bate...@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.

Reply via email to