changeset 51981:48dec0c13bec

8209454: [error-prone] TypeParameterUnusedInFormals in jdk.net Reviewed-by: dfuchs
author chegar
date Tue, 02 Oct 2018 10:40:58 +0100
parents 191c2b7d7186
children df8ae450fce3
files src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);