8209454: [error-prone] TypeParameterUnusedInFormals in jdk.net
authorchegar
Tue, 02 Oct 2018 10:40:58 +0100
changeset 51981 48dec0c13bec
parent 51980 191c2b7d7186
child 51982 df8ae450fce3
8209454: [error-prone] TypeParameterUnusedInFormals in jdk.net Reviewed-by: dfuchs
src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java
--- a/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java	Tue Oct 02 09:05:07 2018 +0100
+++ b/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java	Tue Oct 02 10:40:58 2018 +0100
@@ -206,7 +206,7 @@
 
                 if (option == SO_FLOW_SLA) {
                     assert flowSupported;
-                    SocketFlow flow = checkValueType(value, option.type());
+                    SocketFlow flow = checkValueType(value, SocketFlow.class);
                     setFlowOption(fd, flow);
                 } else if (option == TCP_QUICKACK) {
                     setQuickAckOption(fd, (boolean) value);
@@ -254,7 +254,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    private static <T> T checkValueType(Object value, Class<?> type) {
+    private static <T> T checkValueType(Object value, Class<T> type) {
         if (!type.isAssignableFrom(value.getClass())) {
             String s = "Found: " + value.getClass() + ", Expected: " + type;
             throw new IllegalArgumentException(s);