8041397: Lint regression in java.net.SocketOption
authormichaelm
Wed, 23 Apr 2014 17:29:51 +0100
changeset 24046 d1f6da65881a
parent 24045 31a23ee57590
child 24047 e4dc2768f533
8041397: Lint regression in java.net.SocketOption Reviewed-by: rriggs
jdk/src/share/classes/java/net/DatagramSocketImpl.java
jdk/src/share/classes/java/net/SocketImpl.java
jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java
jdk/src/solaris/classes/java/net/PlainSocketImpl.java
--- a/jdk/src/share/classes/java/net/DatagramSocketImpl.java	Wed Apr 23 13:19:21 2014 +0100
+++ b/jdk/src/share/classes/java/net/DatagramSocketImpl.java	Wed Apr 23 17:29:51 2014 +0100
@@ -311,6 +311,7 @@
      *
      * @since 1.9
      */
+    @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
         if (name == StandardSocketOptions.SO_SNDBUF) {
             return (T) getOption(SocketOptions.SO_SNDBUF);
--- a/jdk/src/share/classes/java/net/SocketImpl.java	Wed Apr 23 13:19:21 2014 +0100
+++ b/jdk/src/share/classes/java/net/SocketImpl.java	Wed Apr 23 17:29:51 2014 +0100
@@ -408,6 +408,7 @@
      *
      * @since 1.9
      */
+    @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
         if (name == StandardSocketOptions.SO_KEEPALIVE) {
             return (T)getOption(SocketOptions.SO_KEEPALIVE);
--- a/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java	Wed Apr 23 13:19:21 2014 +0100
+++ b/jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java	Wed Apr 23 17:29:51 2014 +0100
@@ -56,6 +56,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
         if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
             return super.getOption(name);
@@ -70,7 +71,7 @@
     }
 
     protected Set<SocketOption<?>> supportedOptions() {
-        HashSet<SocketOption<?>> options = new HashSet(
+        HashSet<SocketOption<?>> options = new HashSet<>(
             super.supportedOptions());
 
         if (flowSupported()) {
--- a/jdk/src/solaris/classes/java/net/PlainSocketImpl.java	Wed Apr 23 13:19:21 2014 +0100
+++ b/jdk/src/solaris/classes/java/net/PlainSocketImpl.java	Wed Apr 23 17:29:51 2014 +0100
@@ -70,6 +70,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
         if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
             return super.getOption(name);
@@ -84,7 +85,7 @@
     }
 
     protected Set<SocketOption<?>> supportedOptions() {
-        HashSet<SocketOption<?>> options = new HashSet(
+        HashSet<SocketOption<?>> options = new HashSet<>(
             super.supportedOptions());
 
         if (getSocket() != null && flowSupported()) {