Skip to content

Commit 76baace

Browse files
author
Bradford Wetmore
committed
8273045: Fix misc javadoc bugs in the java.security and javax.net.ssl code
Reviewed-by: xuelei
1 parent b16a04e commit 76baace

File tree

10 files changed

+40
-35
lines changed

10 files changed

+40
-35
lines changed

src/java.base/share/classes/java/security/AuthProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@ protected AuthProvider(String name, String versionStr, String info) {
9696
* from the caller, which may be {@code null}
9797
*
9898
* @throws IllegalStateException if the provider requires configuration
99-
* and {@link configure} has not been called
99+
* and {@link #configure} has not been called
100100
* @throws LoginException if the login operation fails
101101
* @throws SecurityException if the caller does not pass a
102102
* security check for
@@ -111,7 +111,7 @@ public abstract void login(Subject subject, CallbackHandler handler)
111111
* Log out from this provider.
112112
*
113113
* @throws IllegalStateException if the provider requires configuration
114-
* and {@link configure} has not been called
114+
* and {@link #configure} has not been called
115115
* @throws LoginException if the logout operation fails
116116
* @throws SecurityException if the caller does not pass a
117117
* security check for
@@ -139,7 +139,7 @@ public abstract void login(Subject subject, CallbackHandler handler)
139139
* authentication information, which may be {@code null}
140140
*
141141
* @throws IllegalStateException if the provider requires configuration
142-
* and {@link configure} has not been called
142+
* and {@link #configure} has not been called
143143
* @throws SecurityException if the caller does not pass a
144144
* security check for
145145
* {@code SecurityPermission("authProvider.name")},

src/java.base/share/classes/javax/net/ssl/SNIHostName.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.util.Locale;
3535
import java.util.Objects;
3636
import java.util.regex.Pattern;
37+
import java.util.regex.PatternSyntaxException;
3738

3839
/**
3940
* Instances of this class represent a server name of type
@@ -297,7 +298,7 @@ public String toString() {
297298
* @return a {@code SNIMatcher} object for {@code SNIHostName}s
298299
* @throws NullPointerException if {@code regex} is
299300
* {@code null}
300-
* @throws java.util.regex.PatternSyntaxException if the regular expression's
301+
* @throws PatternSyntaxException if the regular expression's
301302
* syntax is invalid
302303
*/
303304
public static SNIMatcher createSNIMatcher(String regex) {

src/java.base/share/classes/javax/net/ssl/SNIMatcher.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
2525

2626
package javax.net.ssl;
2727

28+
import java.util.Collection;
29+
2830
/**
2931
* Instances of this class represent a matcher that performs match
3032
* operations on an {@link SNIServerName} instance.

src/java.base/share/classes/javax/net/ssl/SNIServerName.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
2727

2828
import java.util.Arrays;
2929
import java.util.HexFormat;
30+
import java.util.List;
3031

3132
/**
3233
* Instances of this class represent a server name in a Server Name

src/java.base/share/classes/javax/net/ssl/SSLContextSpi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public SSLContextSpi() {}
5151
* @param tm the sources of peer authentication trust decisions
5252
* @param sr the source of randomness
5353
* @throws KeyManagementException if this operation fails
54-
* @see SSLContext#init(KeyManager [], TrustManager [], SecureRandom)
54+
* @see SSLContext#init(KeyManager[], TrustManager[], SecureRandom)
5555
*/
5656
protected abstract void engineInit(KeyManager[] km, TrustManager[] tm,
5757
SecureRandom sr) throws KeyManagementException;

src/java.base/share/classes/javax/net/ssl/SSLEngine.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
*
313313
* <LI> <em>Enabled</em> cipher suites, which may be fewer than
314314
* the full set of supported suites. This group is set using the
315-
* {@link #setEnabledCipherSuites(String [])} method, and
315+
* {@link #setEnabledCipherSuites(String[])} method, and
316316
* queried using the {@link #getEnabledCipherSuites()} method.
317317
* Initially, a default set of cipher suites will be enabled on a
318318
* new engine that represents the minimum suggested
@@ -495,8 +495,8 @@ public int getPeerPort() {
495495
* An invocation of this method behaves in exactly the same manner
496496
* as the invocation:
497497
* <blockquote><pre>
498-
* {@link #wrap(ByteBuffer [], int, int, ByteBuffer)
499-
* engine.wrap(new ByteBuffer [] { src }, 0, 1, dst);}
498+
* {@link #wrap(ByteBuffer[], int, int, ByteBuffer)
499+
* engine.wrap(new ByteBuffer[] { src }, 0, 1, dst);}
500500
* </pre></blockquote>
501501
*
502502
* @param src
@@ -517,7 +517,7 @@ public int getPeerPort() {
517517
* is null.
518518
* @throws IllegalStateException if the client/server mode
519519
* has not yet been set.
520-
* @see #wrap(ByteBuffer [], int, int, ByteBuffer)
520+
* @see #wrap(ByteBuffer[], int, int, ByteBuffer)
521521
*/
522522
public SSLEngineResult wrap(ByteBuffer src,
523523
ByteBuffer dst) throws SSLException {
@@ -531,7 +531,7 @@ public SSLEngineResult wrap(ByteBuffer src,
531531
* An invocation of this method behaves in exactly the same manner
532532
* as the invocation:
533533
* <blockquote><pre>
534-
* {@link #wrap(ByteBuffer [], int, int, ByteBuffer)
534+
* {@link #wrap(ByteBuffer[], int, int, ByteBuffer)
535535
* engine.wrap(srcs, 0, srcs.length, dst);}
536536
* </pre></blockquote>
537537
*
@@ -554,7 +554,7 @@ public SSLEngineResult wrap(ByteBuffer src,
554554
* is null, or if any element in {@code srcs} is null.
555555
* @throws IllegalStateException if the client/server mode
556556
* has not yet been set.
557-
* @see #wrap(ByteBuffer [], int, int, ByteBuffer)
557+
* @see #wrap(ByteBuffer[], int, int, ByteBuffer)
558558
*/
559559
public SSLEngineResult wrap(ByteBuffer [] srcs,
560560
ByteBuffer dst) throws SSLException {
@@ -650,8 +650,8 @@ public abstract SSLEngineResult wrap(ByteBuffer [] srcs, int offset,
650650
* An invocation of this method behaves in exactly the same manner
651651
* as the invocation:
652652
* <blockquote><pre>
653-
* {@link #unwrap(ByteBuffer, ByteBuffer [], int, int)
654-
* engine.unwrap(src, new ByteBuffer [] { dst }, 0, 1);}
653+
* {@link #unwrap(ByteBuffer, ByteBuffer[], int, int)
654+
* engine.unwrap(src, new ByteBuffer[] { dst }, 0, 1);}
655655
* </pre></blockquote>
656656
*
657657
* @param src
@@ -672,7 +672,7 @@ public abstract SSLEngineResult wrap(ByteBuffer [] srcs, int offset,
672672
* is null.
673673
* @throws IllegalStateException if the client/server mode
674674
* has not yet been set.
675-
* @see #unwrap(ByteBuffer, ByteBuffer [], int, int)
675+
* @see #unwrap(ByteBuffer, ByteBuffer[], int, int)
676676
*/
677677
public SSLEngineResult unwrap(ByteBuffer src,
678678
ByteBuffer dst) throws SSLException {
@@ -686,7 +686,7 @@ public SSLEngineResult unwrap(ByteBuffer src,
686686
* An invocation of this method behaves in exactly the same manner
687687
* as the invocation:
688688
* <blockquote><pre>
689-
* {@link #unwrap(ByteBuffer, ByteBuffer [], int, int)
689+
* {@link #unwrap(ByteBuffer, ByteBuffer[], int, int)
690690
* engine.unwrap(src, dsts, 0, dsts.length);}
691691
* </pre></blockquote>
692692
*
@@ -709,7 +709,7 @@ public SSLEngineResult unwrap(ByteBuffer src,
709709
* is null, or if any element in {@code dsts} is null.
710710
* @throws IllegalStateException if the client/server mode
711711
* has not yet been set.
712-
* @see #unwrap(ByteBuffer, ByteBuffer [], int, int)
712+
* @see #unwrap(ByteBuffer, ByteBuffer[], int, int)
713713
*/
714714
public SSLEngineResult unwrap(ByteBuffer src,
715715
ByteBuffer [] dsts) throws SSLException {
@@ -926,7 +926,7 @@ public abstract SSLEngineResult unwrap(ByteBuffer src,
926926
*
927927
* @return an array of cipher suite names
928928
* @see #getEnabledCipherSuites()
929-
* @see #setEnabledCipherSuites(String [])
929+
* @see #setEnabledCipherSuites(String[])
930930
*/
931931
public abstract String [] getSupportedCipherSuites();
932932

@@ -952,7 +952,7 @@ public abstract SSLEngineResult unwrap(ByteBuffer src,
952952
*
953953
* @return an array of cipher suite names
954954
* @see #getSupportedCipherSuites()
955-
* @see #setEnabledCipherSuites(String [])
955+
* @see #setEnabledCipherSuites(String[])
956956
*/
957957
public abstract String [] getEnabledCipherSuites();
958958

@@ -983,7 +983,7 @@ public abstract SSLEngineResult unwrap(ByteBuffer src,
983983
* @see #getSupportedCipherSuites()
984984
* @see #getEnabledCipherSuites()
985985
*/
986-
public abstract void setEnabledCipherSuites(String suites []);
986+
public abstract void setEnabledCipherSuites(String[] suites);
987987

988988

989989
/**
@@ -1005,7 +1005,7 @@ public abstract SSLEngineResult unwrap(ByteBuffer src,
10051005
* by the protocol.
10061006
*
10071007
* @return an array of protocols
1008-
* @see #setEnabledProtocols(String [])
1008+
* @see #setEnabledProtocols(String[])
10091009
*/
10101010
public abstract String [] getEnabledProtocols();
10111011

@@ -1024,7 +1024,7 @@ public abstract SSLEngineResult unwrap(ByteBuffer src,
10241024
* when the protocols parameter is null.
10251025
* @see #getEnabledProtocols()
10261026
*/
1027-
public abstract void setEnabledProtocols(String protocols[]);
1027+
public abstract void setEnabledProtocols(String[] protocols);
10281028

10291029

10301030
/**
@@ -1161,7 +1161,7 @@ public SSLSession getHandshakeSession() {
11611161
*
11621162
* @implNote
11631163
* The JDK SunJSSE provider implementation returns false unless
1164-
* {@link setUseClientMode(boolean)} is used to change the mode to true.
1164+
* {@link #setUseClientMode(boolean)} is used to change the mode to true.
11651165
*
11661166
* @return true if the engine should do handshaking
11671167
* in "client" mode

src/java.base/share/classes/javax/net/ssl/SSLEngineResult.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
2525

2626
package javax.net.ssl;
2727

28+
import java.nio.ByteBuffer;
29+
2830
/**
2931
* An encapsulation of the result state produced by
3032
* {@code SSLEngine} I/O calls.

src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,11 @@
2323
* questions.
2424
*/
2525

26-
2726
package javax.net.ssl;
2827

2928
import java.io.*;
3029
import java.net.*;
3130

32-
3331
/**
3432
* This class extends <code>ServerSocket</code> and
3533
* provides secure server sockets using protocols such as the Secure
@@ -205,7 +203,7 @@ protected SSLServerSocket(int port, int backlog, InetAddress address)
205203
*
206204
* @return an array of cipher suites enabled
207205
* @see #getSupportedCipherSuites()
208-
* @see #setEnabledCipherSuites(String [])
206+
* @see #setEnabledCipherSuites(String[])
209207
*/
210208
public abstract String [] getEnabledCipherSuites();
211209

@@ -261,7 +259,7 @@ protected SSLServerSocket(int port, int backlog, InetAddress address)
261259
*
262260
* @return an array of cipher suite names
263261
* @see #getEnabledCipherSuites()
264-
* @see #setEnabledCipherSuites(String [])
262+
* @see #setEnabledCipherSuites(String[])
265263
*/
266264
public abstract String [] getSupportedCipherSuites();
267265

@@ -271,7 +269,7 @@ protected SSLServerSocket(int port, int backlog, InetAddress address)
271269
*
272270
* @return an array of protocol names supported
273271
* @see #getEnabledProtocols()
274-
* @see #setEnabledProtocols(String [])
272+
* @see #setEnabledProtocols(String[])
275273
*/
276274
public abstract String [] getSupportedProtocols();
277275

@@ -287,7 +285,7 @@ protected SSLServerSocket(int port, int backlog, InetAddress address)
287285
*
288286
* @return an array of protocol names
289287
* @see #getSupportedProtocols()
290-
* @see #setEnabledProtocols(String [])
288+
* @see #setEnabledProtocols(String[])
291289
*/
292290
public abstract String [] getEnabledProtocols();
293291

src/java.base/share/classes/javax/net/ssl/SSLSession.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
package javax.net.ssl;
2727

2828
import java.security.Principal;
29+
import java.nio.ByteBuffer;
2930

3031
/**
3132
* In SSL, sessions are used to describe an ongoing relationship between

src/java.base/share/classes/javax/net/ssl/X509ExtendedTrustManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,8 @@
2626
package javax.net.ssl;
2727

2828
import java.net.Socket;
29-
import javax.net.ssl.X509TrustManager;
3029

30+
import java.security.AlgorithmConstraints;
3131
import java.security.cert.X509Certificate;
3232
import java.security.cert.CertificateException;
3333

0 commit comments

Comments
 (0)