diff --git a/src/java.base/share/classes/java/security/AuthProvider.java b/src/java.base/share/classes/java/security/AuthProvider.java index aad4bf0a570..1c0ce64c625 100644 --- a/src/java.base/share/classes/java/security/AuthProvider.java +++ b/src/java.base/share/classes/java/security/AuthProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -96,7 +96,7 @@ public abstract class AuthProvider extends Provider { * from the caller, which may be {@code null} * * @throws IllegalStateException if the provider requires configuration - * and {@link configure} has not been called + * and {@link #configure} has not been called * @throws LoginException if the login operation fails * @throws SecurityException if the caller does not pass a * security check for @@ -111,7 +111,7 @@ public abstract class AuthProvider extends Provider { * Log out from this provider. * * @throws IllegalStateException if the provider requires configuration - * and {@link configure} has not been called + * and {@link #configure} has not been called * @throws LoginException if the logout operation fails * @throws SecurityException if the caller does not pass a * security check for @@ -139,7 +139,7 @@ public abstract class AuthProvider extends Provider { * authentication information, which may be {@code null} * * @throws IllegalStateException if the provider requires configuration - * and {@link configure} has not been called + * and {@link #configure} has not been called * @throws SecurityException if the caller does not pass a * security check for * {@code SecurityPermission("authProvider.name")}, diff --git a/src/java.base/share/classes/javax/net/ssl/SNIHostName.java b/src/java.base/share/classes/javax/net/ssl/SNIHostName.java index 9f16152b8c8..5e4e545a2df 100644 --- a/src/java.base/share/classes/javax/net/ssl/SNIHostName.java +++ b/src/java.base/share/classes/javax/net/ssl/SNIHostName.java @@ -34,6 +34,7 @@ import java.nio.charset.CharacterCodingException; import java.util.Locale; import java.util.Objects; import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; /** * Instances of this class represent a server name of type @@ -297,7 +298,7 @@ public final class SNIHostName extends SNIServerName { * @return a {@code SNIMatcher} object for {@code SNIHostName}s * @throws NullPointerException if {@code regex} is * {@code null} - * @throws java.util.regex.PatternSyntaxException if the regular expression's + * @throws PatternSyntaxException if the regular expression's * syntax is invalid */ public static SNIMatcher createSNIMatcher(String regex) { diff --git a/src/java.base/share/classes/javax/net/ssl/SNIMatcher.java b/src/java.base/share/classes/javax/net/ssl/SNIMatcher.java index a6c9ab92ee2..a83a566fb7f 100644 --- a/src/java.base/share/classes/javax/net/ssl/SNIMatcher.java +++ b/src/java.base/share/classes/javax/net/ssl/SNIMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -25,6 +25,8 @@ package javax.net.ssl; +import java.util.Collection; + /** * Instances of this class represent a matcher that performs match * operations on an {@link SNIServerName} instance. diff --git a/src/java.base/share/classes/javax/net/ssl/SNIServerName.java b/src/java.base/share/classes/javax/net/ssl/SNIServerName.java index d0ec849f71b..46df9d11a6e 100644 --- a/src/java.base/share/classes/javax/net/ssl/SNIServerName.java +++ b/src/java.base/share/classes/javax/net/ssl/SNIServerName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -27,6 +27,7 @@ package javax.net.ssl; import java.util.Arrays; import java.util.HexFormat; +import java.util.List; /** * Instances of this class represent a server name in a Server Name diff --git a/src/java.base/share/classes/javax/net/ssl/SSLContextSpi.java b/src/java.base/share/classes/javax/net/ssl/SSLContextSpi.java index 4e2a4148193..29fa2032c7c 100644 --- a/src/java.base/share/classes/javax/net/ssl/SSLContextSpi.java +++ b/src/java.base/share/classes/javax/net/ssl/SSLContextSpi.java @@ -51,7 +51,7 @@ public abstract class SSLContextSpi { * @param tm the sources of peer authentication trust decisions * @param sr the source of randomness * @throws KeyManagementException if this operation fails - * @see SSLContext#init(KeyManager [], TrustManager [], SecureRandom) + * @see SSLContext#init(KeyManager[], TrustManager[], SecureRandom) */ protected abstract void engineInit(KeyManager[] km, TrustManager[] tm, SecureRandom sr) throws KeyManagementException; diff --git a/src/java.base/share/classes/javax/net/ssl/SSLEngine.java b/src/java.base/share/classes/javax/net/ssl/SSLEngine.java index 0102c17f2e2..fff674ca1fd 100644 --- a/src/java.base/share/classes/javax/net/ssl/SSLEngine.java +++ b/src/java.base/share/classes/javax/net/ssl/SSLEngine.java @@ -312,7 +312,7 @@ import java.util.function.BiFunction; * *
- * {@link #wrap(ByteBuffer [], int, int, ByteBuffer)
- * engine.wrap(new ByteBuffer [] { src }, 0, 1, dst);}
+ * {@link #wrap(ByteBuffer[], int, int, ByteBuffer)
+ * engine.wrap(new ByteBuffer[] { src }, 0, 1, dst);}
*
*
* @param src
@@ -517,7 +517,7 @@ public abstract class SSLEngine {
* is null.
* @throws IllegalStateException if the client/server mode
* has not yet been set.
- * @see #wrap(ByteBuffer [], int, int, ByteBuffer)
+ * @see #wrap(ByteBuffer[], int, int, ByteBuffer)
*/
public SSLEngineResult wrap(ByteBuffer src,
ByteBuffer dst) throws SSLException {
@@ -531,7 +531,7 @@ public abstract class SSLEngine {
* An invocation of this method behaves in exactly the same manner
* as the invocation:
*
- * {@link #wrap(ByteBuffer [], int, int, ByteBuffer)
+ * {@link #wrap(ByteBuffer[], int, int, ByteBuffer)
* engine.wrap(srcs, 0, srcs.length, dst);}
*
*
@@ -554,7 +554,7 @@ public abstract class SSLEngine {
* is null, or if any element in {@code srcs} is null.
* @throws IllegalStateException if the client/server mode
* has not yet been set.
- * @see #wrap(ByteBuffer [], int, int, ByteBuffer)
+ * @see #wrap(ByteBuffer[], int, int, ByteBuffer)
*/
public SSLEngineResult wrap(ByteBuffer [] srcs,
ByteBuffer dst) throws SSLException {
@@ -650,8 +650,8 @@ public abstract class SSLEngine {
* An invocation of this method behaves in exactly the same manner
* as the invocation:
*
- * {@link #unwrap(ByteBuffer, ByteBuffer [], int, int)
- * engine.unwrap(src, new ByteBuffer [] { dst }, 0, 1);}
+ * {@link #unwrap(ByteBuffer, ByteBuffer[], int, int)
+ * engine.unwrap(src, new ByteBuffer[] { dst }, 0, 1);}
*
*
* @param src
@@ -672,7 +672,7 @@ public abstract class SSLEngine {
* is null.
* @throws IllegalStateException if the client/server mode
* has not yet been set.
- * @see #unwrap(ByteBuffer, ByteBuffer [], int, int)
+ * @see #unwrap(ByteBuffer, ByteBuffer[], int, int)
*/
public SSLEngineResult unwrap(ByteBuffer src,
ByteBuffer dst) throws SSLException {
@@ -686,7 +686,7 @@ public abstract class SSLEngine {
* An invocation of this method behaves in exactly the same manner
* as the invocation:
*
- * {@link #unwrap(ByteBuffer, ByteBuffer [], int, int)
+ * {@link #unwrap(ByteBuffer, ByteBuffer[], int, int)
* engine.unwrap(src, dsts, 0, dsts.length);}
*
*
@@ -709,7 +709,7 @@ public abstract class SSLEngine {
* is null, or if any element in {@code dsts} is null.
* @throws IllegalStateException if the client/server mode
* has not yet been set.
- * @see #unwrap(ByteBuffer, ByteBuffer [], int, int)
+ * @see #unwrap(ByteBuffer, ByteBuffer[], int, int)
*/
public SSLEngineResult unwrap(ByteBuffer src,
ByteBuffer [] dsts) throws SSLException {
@@ -926,7 +926,7 @@ public abstract class SSLEngine {
*
* @return an array of cipher suite names
* @see #getEnabledCipherSuites()
- * @see #setEnabledCipherSuites(String [])
+ * @see #setEnabledCipherSuites(String[])
*/
public abstract String [] getSupportedCipherSuites();
@@ -952,7 +952,7 @@ public abstract class SSLEngine {
*
* @return an array of cipher suite names
* @see #getSupportedCipherSuites()
- * @see #setEnabledCipherSuites(String [])
+ * @see #setEnabledCipherSuites(String[])
*/
public abstract String [] getEnabledCipherSuites();
@@ -983,7 +983,7 @@ public abstract class SSLEngine {
* @see #getSupportedCipherSuites()
* @see #getEnabledCipherSuites()
*/
- public abstract void setEnabledCipherSuites(String suites []);
+ public abstract void setEnabledCipherSuites(String[] suites);
/**
@@ -1005,7 +1005,7 @@ public abstract class SSLEngine {
* by the protocol.
*
* @return an array of protocols
- * @see #setEnabledProtocols(String [])
+ * @see #setEnabledProtocols(String[])
*/
public abstract String [] getEnabledProtocols();
@@ -1024,7 +1024,7 @@ public abstract class SSLEngine {
* when the protocols parameter is null.
* @see #getEnabledProtocols()
*/
- public abstract void setEnabledProtocols(String protocols[]);
+ public abstract void setEnabledProtocols(String[] protocols);
/**
@@ -1161,7 +1161,7 @@ public abstract class SSLEngine {
*
* @implNote
* The JDK SunJSSE provider implementation returns false unless
- * {@link setUseClientMode(boolean)} is used to change the mode to true.
+ * {@link #setUseClientMode(boolean)} is used to change the mode to true.
*
* @return true if the engine should do handshaking
* in "client" mode
diff --git a/src/java.base/share/classes/javax/net/ssl/SSLEngineResult.java b/src/java.base/share/classes/javax/net/ssl/SSLEngineResult.java
index 277b09178e5..ccb0222fb21 100644
--- a/src/java.base/share/classes/javax/net/ssl/SSLEngineResult.java
+++ b/src/java.base/share/classes/javax/net/ssl/SSLEngineResult.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2021, 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
@@ -25,6 +25,8 @@
package javax.net.ssl;
+import java.nio.ByteBuffer;
+
/**
* An encapsulation of the result state produced by
* {@code SSLEngine} I/O calls.
diff --git a/src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java b/src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java
index cb0a500608f..00a8bed19f0 100644
--- a/src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java
+++ b/src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2021, 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
@@ -23,13 +23,11 @@
* questions.
*/
-
package javax.net.ssl;
import java.io.*;
import java.net.*;
-
/**
* This class extends ServerSocket and
* provides secure server sockets using protocols such as the Secure
@@ -205,7 +203,7 @@ public abstract class SSLServerSocket extends ServerSocket {
*
* @return an array of cipher suites enabled
* @see #getSupportedCipherSuites()
- * @see #setEnabledCipherSuites(String [])
+ * @see #setEnabledCipherSuites(String[])
*/
public abstract String [] getEnabledCipherSuites();
@@ -261,7 +259,7 @@ public abstract class SSLServerSocket extends ServerSocket {
*
* @return an array of cipher suite names
* @see #getEnabledCipherSuites()
- * @see #setEnabledCipherSuites(String [])
+ * @see #setEnabledCipherSuites(String[])
*/
public abstract String [] getSupportedCipherSuites();
@@ -271,7 +269,7 @@ public abstract class SSLServerSocket extends ServerSocket {
*
* @return an array of protocol names supported
* @see #getEnabledProtocols()
- * @see #setEnabledProtocols(String [])
+ * @see #setEnabledProtocols(String[])
*/
public abstract String [] getSupportedProtocols();
@@ -287,7 +285,7 @@ public abstract class SSLServerSocket extends ServerSocket {
*
* @return an array of protocol names
* @see #getSupportedProtocols()
- * @see #setEnabledProtocols(String [])
+ * @see #setEnabledProtocols(String[])
*/
public abstract String [] getEnabledProtocols();
diff --git a/src/java.base/share/classes/javax/net/ssl/SSLSession.java b/src/java.base/share/classes/javax/net/ssl/SSLSession.java
index e89cee6477f..242e4fb94cf 100644
--- a/src/java.base/share/classes/javax/net/ssl/SSLSession.java
+++ b/src/java.base/share/classes/javax/net/ssl/SSLSession.java
@@ -26,6 +26,7 @@
package javax.net.ssl;
import java.security.Principal;
+import java.nio.ByteBuffer;
/**
* In SSL, sessions are used to describe an ongoing relationship between
diff --git a/src/java.base/share/classes/javax/net/ssl/X509ExtendedTrustManager.java b/src/java.base/share/classes/javax/net/ssl/X509ExtendedTrustManager.java
index b2064cdc4c3..90a2e5b6873 100644
--- a/src/java.base/share/classes/javax/net/ssl/X509ExtendedTrustManager.java
+++ b/src/java.base/share/classes/javax/net/ssl/X509ExtendedTrustManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2021, 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
@@ -26,8 +26,8 @@
package javax.net.ssl;
import java.net.Socket;
-import javax.net.ssl.X509TrustManager;
+import java.security.AlgorithmConstraints;
import java.security.cert.X509Certificate;
import java.security.cert.CertificateException;