--- a/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Tue May 24 11:31:25 2016 +0100
+++ b/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Tue May 24 12:31:30 2016 +0100
@@ -87,27 +87,22 @@
return isReusePortAvailable;
}
- private static volatile Set<SocketOption<?>> socketOptions;
-
/**
- * Returns a set of SocketOptions supported by this impl
- * and by this impl's socket (Socket or ServerSocket)
+ * Returns a set of SocketOptions supported by this impl and by this impl's
+ * socket (Socket or ServerSocket)
*
* @return a Set of SocketOptions
*/
@Override
protected Set<SocketOption<?>> supportedOptions() {
- Set<SocketOption<?>> options = socketOptions;
- if (options == null) {
- if (isReusePortAvailable()) {
- options = new HashSet<>();
- options.addAll(super.supportedOptions());
- options.add(StandardSocketOptions.SO_REUSEPORT);
- options = Collections.unmodifiableSet(options);
- } else {
- options = super.supportedOptions();
- }
- socketOptions = options;
+ Set<SocketOption<?>> options;
+ if (isReusePortAvailable()) {
+ options = new HashSet<>();
+ options.addAll(super.supportedOptions());
+ options.add(StandardSocketOptions.SO_REUSEPORT);
+ options = Collections.unmodifiableSet(options);
+ } else {
+ options = super.supportedOptions();
}
return options;
}