8209454: [error-prone] TypeParameterUnusedInFormals in jdk.net
Reviewed-by: dfuchs
--- 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);