From f95097cc64f1d7647f8328b623e9bd9f1180b6d8 Mon Sep 17 00:00:00 2001 From: Archie Cobbs Date: Tue, 5 Nov 2024 15:46:00 +0000 Subject: [PATCH] 8343482: Remove unnecessary @SuppressWarnings annotations (net) Reviewed-by: dfuchs --- src/java.base/share/classes/java/net/Socket.java | 1 - .../sun/net/www/protocol/http/NegotiateAuthentication.java | 4 +--- .../sun/net/www/protocol/http/ntlm/NTLMAuthentication.java | 4 +--- src/jdk.net/share/classes/jdk/net/Sockets.java | 3 +-- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/java.base/share/classes/java/net/Socket.java b/src/java.base/share/classes/java/net/Socket.java index 309fa7a80d0..5fe6d1e0bb3 100644 --- a/src/java.base/share/classes/java/net/Socket.java +++ b/src/java.base/share/classes/java/net/Socket.java @@ -2057,7 +2057,6 @@ public class Socket implements java.io.Closeable { * * @since 9 */ - @SuppressWarnings("unchecked") public T getOption(SocketOption name) throws IOException { Objects.requireNonNull(name); if (isClosed()) diff --git a/src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java b/src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java index 7881a1480c9..27442382ec7 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java +++ b/src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,6 @@ class NegotiateAuthentication extends AuthenticationInfo { @java.io.Serial private static final long serialVersionUID = 100L; - @SuppressWarnings("serial") // Not statically typed as Serializable private final HttpCallerInfo hci; // These maps are used to manage the GSS availability for different @@ -71,7 +70,6 @@ class NegotiateAuthentication extends AuthenticationInfo { } // The HTTP Negotiate Helper - @SuppressWarnings("serial") // Not statically typed as Serializable private Negotiator negotiator = null; /** diff --git a/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java b/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java index 050e12e3594..8a2944081d5 100644 --- a/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java +++ b/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,10 +120,8 @@ public class NTLMAuthentication extends AuthenticationInfo { }); }; - @SuppressWarnings("serial") // Type of field is not Serializable PasswordAuthentication pw; - @SuppressWarnings("serial") // Type of field is not Serializable Client client; /** * Create a NTLMAuthentication: diff --git a/src/jdk.net/share/classes/jdk/net/Sockets.java b/src/jdk.net/share/classes/jdk/net/Sockets.java index a8effd8dba6..3d113b562ae 100644 --- a/src/jdk.net/share/classes/jdk/net/Sockets.java +++ b/src/jdk.net/share/classes/jdk/net/Sockets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -303,7 +303,6 @@ public class Sockets { return isReusePortAvailable; } - @SuppressWarnings("removal") private static Map,Set>> optionSets() { Map,Set>> options = new HashMap<>(); boolean incomingNapiIdsupported = PlatformSocketOptions.get().incomingNapiIdSupported();