Skip to content

Commit 32cbd19

Browse files
author
Bradford Wetmore
committed
8263105: security-libs doclint cleanup
Reviewed-by: iris, darcy, dfuchs, mullan
1 parent 6971c23 commit 32cbd19

35 files changed

+294
-79
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, 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
@@ -46,7 +46,9 @@ public class AccessControlException extends SecurityException {
4646
@java.io.Serial
4747
private static final long serialVersionUID = 5138225684096988535L;
4848

49-
// the permission that caused the exception to be thrown.
49+
/**
50+
* The permission that caused the exception to be thrown.
51+
*/
5052
private Permission perm;
5153

5254
/**

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 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
@@ -161,7 +161,10 @@ final class AllPermissionCollection
161161
@java.io.Serial
162162
private static final long serialVersionUID = -4023755556366636806L;
163163

164-
private boolean all_allowed; // true if any all permissions have been added
164+
/**
165+
* True if any AllPermissions have been added.
166+
*/
167+
private boolean all_allowed;
165168

166169
/**
167170
* Create an empty AllPermissions object.

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

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2020, 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
@@ -260,6 +260,10 @@ public PermissionCollection newPermissionCollection() {
260260
/**
261261
* readObject is called to restore the state of the BasicPermission from
262262
* a stream.
263+
*
264+
* @param s the {@code ObjectInputStream} from which data is read
265+
* @throws IOException if an I/O error occurs
266+
* @throws ClassNotFoundException if a serialized class cannot be loaded
263267
*/
264268
@java.io.Serial
265269
private void readObject(ObjectInputStream s)
@@ -488,13 +492,17 @@ public Enumeration<Permission> elements() {
488492
new ObjectStreamField("permClass", Class.class),
489493
};
490494

491-
/**
495+
/*
492496
* @serialData Default fields.
493497
*/
494-
/*
498+
499+
/**
495500
* Writes the contents of the perms field out as a Hashtable for
496501
* serialization compatibility with earlier releases. all_allowed
497502
* and permClass unchanged.
503+
*
504+
* @param out the {@code ObjectOutputStream} to which data is written
505+
* @throws IOException if an I/O error occurs
498506
*/
499507
@java.io.Serial
500508
private void writeObject(ObjectOutputStream out) throws IOException {
@@ -517,6 +525,10 @@ private void writeObject(ObjectOutputStream out) throws IOException {
517525
/**
518526
* readObject is called to restore the state of the
519527
* BasicPermissionCollection from a stream.
528+
*
529+
* @param in the {@code ObjectInputStream} from which data is read
530+
* @throws IOException if an I/O error occurs
531+
* @throws ClassNotFoundException if a serialized class cannot be loaded
520532
*/
521533
@java.io.Serial
522534
private void readObject(java.io.ObjectInputStream in)

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

+10-3
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
@@ -48,7 +48,7 @@ public final class CodeSigner implements Serializable {
4848
*/
4949
private CertPath signerCertPath;
5050

51-
/*
51+
/**
5252
* The signature timestamp.
5353
*
5454
* @serial
@@ -165,7 +165,14 @@ public String toString() {
165165
return sb.toString();
166166
}
167167

168-
// Explicitly reset hash code value to -1
168+
/**
169+
* Restores the state of this object from the stream, and explicitly
170+
* resets hash code value to -1.
171+
*
172+
* @param ois the {@code ObjectInputStream} from which data is read
173+
* @throws IOException if an I/O error occurs
174+
* @throws ClassNotFoundException if a serialized class cannot be loaded
175+
*/
169176
@java.io.Serial
170177
private void readObject(ObjectInputStream ois)
171178
throws IOException, ClassNotFoundException {

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, 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
@@ -522,6 +522,9 @@ public String toString() {
522522
* followed by the certificate encoding itself which is written out as an
523523
* array of bytes. Finally, if any code signers are present then the array
524524
* of code signers is serialized and written out too.
525+
*
526+
* @param oos the {@code ObjectOutputStream} to which data is written
527+
* @throws IOException if an I/O error occurs
525528
*/
526529
@java.io.Serial
527530
private void writeObject(java.io.ObjectOutputStream oos)
@@ -557,6 +560,10 @@ private void writeObject(java.io.ObjectOutputStream oos)
557560

558561
/**
559562
* Restores this object from a stream (i.e., deserializes it).
563+
*
564+
* @param ois the {@code ObjectInputStream} from which data is read
565+
* @throws IOException if an I/O error occurs
566+
* @throws ClassNotFoundException if a serialized class cannot be loaded
560567
*/
561568
@java.io.Serial
562569
private void readObject(java.io.ObjectInputStream ois)

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

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, 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
@@ -25,6 +25,8 @@
2525

2626
package java.security;
2727

28+
import java.io.IOException;
29+
2830
/**
2931
* A GuardedObject is an object that is used to protect access to
3032
* another object.
@@ -52,10 +54,17 @@ public class GuardedObject implements java.io.Serializable {
5254
@java.io.Serial
5355
private static final long serialVersionUID = -5240450096227834308L;
5456

57+
/**
58+
* The object we are guarding.
59+
*/
5560
@SuppressWarnings("serial") // Not statically typed as Serializable
56-
private Object object; // the object we are guarding
61+
private Object object;
62+
63+
/**
64+
* The guard object.
65+
*/
5766
@SuppressWarnings("serial") // Not statically typed as Serializable
58-
private Guard guard; // the guard
67+
private Guard guard;
5968

6069
/**
6170
* Constructs a GuardedObject using the specified object and guard.
@@ -94,10 +103,13 @@ public Object getObject()
94103
/**
95104
* Writes this object out to a stream (i.e., serializes it).
96105
* We check the guard if there is one.
106+
*
107+
* @param oos the {@code ObjectOutputStream} to which data is written
108+
* @throws IOException if an I/O error occurs
97109
*/
98110
@java.io.Serial
99111
private void writeObject(java.io.ObjectOutputStream oos)
100-
throws java.io.IOException
112+
throws IOException
101113
{
102114
if (guard != null)
103115
guard.checkGuard(object);

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 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
@@ -44,7 +44,10 @@ public final class KeyPair implements java.io.Serializable {
4444
@java.io.Serial
4545
private static final long serialVersionUID = -7565189502268009837L;
4646

47+
/** The private key. */
4748
private PrivateKey privateKey;
49+
50+
/** The public key. */
4851
private PublicKey publicKey;
4952

5053
/**

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, 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
@@ -68,6 +68,9 @@ public abstract class Permission implements Guard, java.io.Serializable {
6868
@java.io.Serial
6969
private static final long serialVersionUID = -5636570222231596674L;
7070

71+
/**
72+
* The permission name.
73+
*/
7174
private String name;
7275

7376
/**

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2020, 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
@@ -99,7 +99,11 @@ public abstract class PermissionCollection implements java.io.Serializable {
9999
@java.io.Serial
100100
private static final long serialVersionUID = -6727011328946861783L;
101101

102-
// when set, add will throw an exception.
102+
/**
103+
* Whether this permission collection is read-only.
104+
* <p>
105+
* If set, the {@code add} method will throw an exception.
106+
*/
103107
private volatile boolean readOnly;
104108

105109
/**

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, 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
@@ -577,11 +577,11 @@ public Enumeration<Permission> elements() {
577577
};
578578

579579
/**
580-
* @serialData Default fields.
581-
*/
582-
/*
583580
* Writes the contents of the permsMap field out as a Hashtable for
584581
* serialization compatibility with earlier releases.
582+
*
583+
* @param out the {@code ObjectOutputStream} to which data is written
584+
* @throws IOException if an I/O error occurs
585585
*/
586586
@java.io.Serial
587587
private void writeObject(ObjectOutputStream out) throws IOException {
@@ -598,9 +598,13 @@ private void writeObject(ObjectOutputStream out) throws IOException {
598598
out.writeFields();
599599
}
600600

601-
/*
601+
/**
602602
* Reads in a Hashtable of Permission/Permission and saves them in the
603603
* permsMap field.
604+
*
605+
* @param in the {@code ObjectInputStream} from which data is read
606+
* @throws IOException if an I/O error occurs
607+
* @throws ClassNotFoundException if a serialized class cannot be loaded
604608
*/
605609
@java.io.Serial
606610
private void readObject(ObjectInputStream in) throws IOException,

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

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 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,23 +96,28 @@ public String toString() {
9696

9797

9898
/**
99-
* Serializable fields for UndeclaredThrowableException.
99+
* The exception thrown by the privileged computation that resulted
100+
* in this {@code PrivilegedActionException}.
100101
*
101-
* @serialField undeclaredThrowable Throwable
102+
* @serialField exception Exception the thrown Exception
102103
*/
103104
@java.io.Serial
104105
private static final ObjectStreamField[] serialPersistentFields = {
105106
new ObjectStreamField("exception", Exception.class)
106107
};
107108

108-
/*
109+
/**
109110
* Reconstitutes the PrivilegedActionException instance from a stream
110111
* and initialize the cause properly when deserializing from an older
111112
* version.
112113
*
113-
* The getException and getCause method returns the private "exception"
114+
* <p>The getException and getCause method returns the private "exception"
114115
* field in the older implementation and PrivilegedActionException::cause
115116
* was set to null.
117+
*
118+
* @param s the {@code ObjectInputStream} from which data is read
119+
* @throws IOException if an I/O error occurs
120+
* @throws ClassNotFoundException if a serialized class cannot be loaded
116121
*/
117122
@java.io.Serial
118123
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
@@ -123,9 +128,12 @@ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundEx
123128
}
124129
}
125130

126-
/*
131+
/**
127132
* To maintain compatibility with older implementation, write a serial
128133
* "exception" field with the cause as the value.
134+
*
135+
* @param out the {@code ObjectOutputStream} to which data is written
136+
* @throws IOException if an I/O error occurs
129137
*/
130138
@java.io.Serial
131139
private void writeObject(ObjectOutputStream out) throws IOException {

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 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
@@ -860,6 +860,8 @@ private void putId() {
860860
* is, then its double value will be used to populate both fields.
861861
*
862862
* @param in the {@code ObjectInputStream} to read
863+
* @throws IOException if an I/O error occurs
864+
* @throws ClassNotFoundException if a serialized class cannot be loaded
863865
* @serial
864866
*/
865867
@java.io.Serial

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 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
@@ -178,8 +178,8 @@ public class SecureRandom extends java.util.Random {
178178
*/
179179
private final boolean threadSafe;
180180

181-
/*
182-
* The algorithm name of null if unknown.
181+
/**
182+
* The algorithm name or {@code null} if unknown.
183183
*
184184
* @serial
185185
* @since 1.5

0 commit comments

Comments
 (0)