changeset 9872:2d9b707020b5

8041397: Lint regression in java.net.SocketOption Reviewed-by: rriggs
author michaelm
date Wed, 23 Apr 2014 17:29:51 +0100
parents ea0d59f39e8f
children 47feccd164b7
files src/share/classes/java/net/DatagramSocketImpl.java src/share/classes/java/net/SocketImpl.java src/solaris/classes/java/net/PlainDatagramSocketImpl.java src/solaris/classes/java/net/PlainSocketImpl.java
diffstat 4 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/net/DatagramSocketImpl.java	Wed Apr 23 13:19:21 2014 +0100
+++ b/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/src/share/classes/java/net/SocketImpl.java	Wed Apr 23 13:19:21 2014 +0100
+++ b/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/src/solaris/classes/java/net/PlainDatagramSocketImpl.java	Wed Apr 23 13:19:21 2014 +0100
+++ b/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/src/solaris/classes/java/net/PlainSocketImpl.java	Wed Apr 23 13:19:21 2014 +0100
+++ b/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()) {