8003587: Warning cleanup in package javax.net.ssl

Removes unnecessary imports and adds missing Override annotations

Reviewed-by: xuelei
This commit is contained in:
Florian Weimer 2012-11-18 01:31:44 -08:00 committed by Xue-Lei Andrew Fan
parent a9594cbceb
commit 28ca680a31
15 changed files with 20 additions and 16 deletions

View File

@ -29,7 +29,6 @@ import java.util.EventObject;
import java.security.cert.Certificate; import java.security.cert.Certificate;
import java.security.Principal; import java.security.Principal;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import javax.security.auth.x500.X500Principal;
/** /**
* This event indicates that an SSL handshake completed on a given * This event indicates that an SSL handshake completed on a given

View File

@ -40,6 +40,7 @@ package javax.net.ssl;
* verification fail. * verification fail.
* *
* @author Brad R. Wetmore * @author Brad R. Wetmore
* @see HostnameVerifierFactory
* @since 1.4 * @since 1.4
*/ */

View File

@ -29,7 +29,6 @@ import java.net.URL;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.security.Principal; import java.security.Principal;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import javax.security.auth.x500.X500Principal;
/** /**
* <code>HttpsURLConnection</code> extends <code>HttpURLConnection</code> * <code>HttpsURLConnection</code> extends <code>HttpURLConnection</code>
@ -196,6 +195,7 @@ class HttpsURLConnection extends HttpURLConnection
*/ */
private static class DefaultHostnameVerifier private static class DefaultHostnameVerifier
implements HostnameVerifier { implements HostnameVerifier {
@Override
public boolean verify(String hostname, SSLSession session) { public boolean verify(String hostname, SSLSession session) {
return false; return false;
} }

View File

@ -68,6 +68,7 @@ public class KeyManagerFactory {
public final static String getDefaultAlgorithm() { public final static String getDefaultAlgorithm() {
String type; String type;
type = AccessController.doPrivileged(new PrivilegedAction<String>() { type = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() { public String run() {
return Security.getProperty( return Security.getProperty(
"ssl.KeyManagerFactory.algorithm"); "ssl.KeyManagerFactory.algorithm");

View File

@ -26,7 +26,6 @@
package javax.net.ssl; package javax.net.ssl;
import java.security.*; import java.security.*;
import java.util.*;
import sun.security.jca.GetInstance; import sun.security.jca.GetInstance;

View File

@ -25,7 +25,6 @@
package javax.net.ssl; package javax.net.ssl;
import java.util.*;
import java.security.*; import java.security.*;
/** /**

View File

@ -230,6 +230,7 @@ public class SSLEngineResult {
/** /**
* Returns a String representation of this object. * Returns a String representation of this object.
*/ */
@Override
public String toString() { public String toString() {
return ("Status = " + status + return ("Status = " + status +
" HandshakeStatus = " + handshakeStatus + " HandshakeStatus = " + handshakeStatus +

View File

@ -28,13 +28,11 @@ package javax.net.ssl;
import java.security.AlgorithmConstraints; import java.security.AlgorithmConstraints;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.regex.Pattern;
/** /**
* Encapsulates parameters for an SSL/TLS connection. The parameters * Encapsulates parameters for an SSL/TLS connection. The parameters

View File

@ -26,11 +26,6 @@
package javax.net.ssl; package javax.net.ssl;
import java.security.*; import java.security.*;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.StringTokenizer;
import java.security.Permissions;
import java.lang.SecurityManager;
/** /**
* This class is for various network permissions. * This class is for various network permissions.

View File

@ -160,23 +160,27 @@ class DefaultSSLServerSocketFactory extends SSLServerSocketFactory {
new SocketException(reason.toString()).initCause(reason); new SocketException(reason.toString()).initCause(reason);
} }
@Override
public ServerSocket createServerSocket() throws IOException { public ServerSocket createServerSocket() throws IOException {
return throwException(); return throwException();
} }
@Override
public ServerSocket createServerSocket(int port) public ServerSocket createServerSocket(int port)
throws IOException throws IOException
{ {
return throwException(); return throwException();
} }
@Override
public ServerSocket createServerSocket(int port, int backlog) public ServerSocket createServerSocket(int port, int backlog)
throws IOException throws IOException
{ {
return throwException(); return throwException();
} }
@Override
public ServerSocket public ServerSocket
createServerSocket(int port, int backlog, InetAddress ifAddress) createServerSocket(int port, int backlog, InetAddress ifAddress)
throws IOException throws IOException
@ -184,10 +188,12 @@ class DefaultSSLServerSocketFactory extends SSLServerSocketFactory {
return throwException(); return throwException();
} }
@Override
public String [] getDefaultCipherSuites() { public String [] getDefaultCipherSuites() {
return new String[0]; return new String[0];
} }
@Override
public String [] getSupportedCipherSuites() { public String [] getSupportedCipherSuites() {
return new String[0]; return new String[0];
} }

View File

@ -25,7 +25,6 @@
package javax.net.ssl; package javax.net.ssl;
import java.net.InetAddress;
import java.security.Principal; import java.security.Principal;
/** /**

View File

@ -28,9 +28,6 @@ package javax.net.ssl;
import java.io.IOException; import java.io.IOException;
import java.net.*; import java.net.*;
import java.util.Enumeration;
import java.util.Vector;
/** /**
* This class extends <code>Socket</code>s and provides secure * This class extends <code>Socket</code>s and provides secure

View File

@ -127,6 +127,7 @@ public abstract class SSLSocketFactory extends SocketFactory
static String getSecurityProperty(final String name) { static String getSecurityProperty(final String name) {
return AccessController.doPrivileged(new PrivilegedAction<String>() { return AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() { public String run() {
String s = java.security.Security.getProperty(name); String s = java.security.Security.getProperty(name);
if (s != null) { if (s != null) {
@ -247,18 +248,21 @@ class DefaultSSLSocketFactory extends SSLSocketFactory
new SocketException(reason.toString()).initCause(reason); new SocketException(reason.toString()).initCause(reason);
} }
@Override
public Socket createSocket() public Socket createSocket()
throws IOException throws IOException
{ {
return throwException(); return throwException();
} }
@Override
public Socket createSocket(String host, int port) public Socket createSocket(String host, int port)
throws IOException throws IOException
{ {
return throwException(); return throwException();
} }
@Override
public Socket createSocket(Socket s, String host, public Socket createSocket(Socket s, String host,
int port, boolean autoClose) int port, boolean autoClose)
throws IOException throws IOException
@ -266,12 +270,14 @@ class DefaultSSLSocketFactory extends SSLSocketFactory
return throwException(); return throwException();
} }
@Override
public Socket createSocket(InetAddress address, int port) public Socket createSocket(InetAddress address, int port)
throws IOException throws IOException
{ {
return throwException(); return throwException();
} }
@Override
public Socket createSocket(String host, int port, public Socket createSocket(String host, int port,
InetAddress clientAddress, int clientPort) InetAddress clientAddress, int clientPort)
throws IOException throws IOException
@ -279,6 +285,7 @@ class DefaultSSLSocketFactory extends SSLSocketFactory
return throwException(); return throwException();
} }
@Override
public Socket createSocket(InetAddress address, int port, public Socket createSocket(InetAddress address, int port,
InetAddress clientAddress, int clientPort) InetAddress clientAddress, int clientPort)
throws IOException throws IOException
@ -286,10 +293,12 @@ class DefaultSSLSocketFactory extends SSLSocketFactory
return throwException(); return throwException();
} }
@Override
public String [] getDefaultCipherSuites() { public String [] getDefaultCipherSuites() {
return new String[0]; return new String[0];
} }
@Override
public String [] getSupportedCipherSuites() { public String [] getSupportedCipherSuites() {
return new String[0]; return new String[0];
} }

View File

@ -65,6 +65,7 @@ public class TrustManagerFactory {
public final static String getDefaultAlgorithm() { public final static String getDefaultAlgorithm() {
String type; String type;
type = AccessController.doPrivileged(new PrivilegedAction<String>() { type = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() { public String run() {
return Security.getProperty( return Security.getProperty(
"ssl.TrustManagerFactory.algorithm"); "ssl.TrustManagerFactory.algorithm");

View File

@ -25,7 +25,6 @@
package javax.net.ssl; package javax.net.ssl;
import java.security.KeyManagementException;
import java.security.PrivateKey; import java.security.PrivateKey;
import java.security.Principal; import java.security.Principal;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;