jdk/src/java.base/unix/classes/java/net/PlainSocketImpl.java
changeset 34968 93b315c61ca3
parent 30963 88469d06e03f
child 36115 0676e37a0b9c
--- a/jdk/src/java.base/unix/classes/java/net/PlainSocketImpl.java	Fri Jan 15 10:30:56 2016 -0800
+++ b/jdk/src/java.base/unix/classes/java/net/PlainSocketImpl.java	Sat Jan 16 00:27:53 2016 +0300
@@ -61,6 +61,9 @@
         if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
             super.setOption(name, value);
         } else {
+            if (getSocket() == null || !flowSupported()) {
+                throw new UnsupportedOperationException("unsupported option");
+            }
             if (isClosedOrPending()) {
                 throw new SocketException("Socket closed");
             }
@@ -75,6 +78,9 @@
         if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
             return super.getOption(name);
         }
+        if (getSocket() == null || !flowSupported()) {
+            throw new UnsupportedOperationException("unsupported option");
+        }
         if (isClosedOrPending()) {
             throw new SocketException("Socket closed");
         }