JDK-8284851 Update javax.crypto files to use proper javadoc for mentioned classes#9282
JDK-8284851 Update javax.crypto files to use proper javadoc for mentioned classes#9282mcpowers wants to merge 14 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back mcpowers! A progress list of the required criteria for merging this PR into |
|
@mcpowers Seems like Skara didn't correctly detect and link the JBS entry. Try renaming your title to just "8284851" and see if that works (It may take a while) |
Webrevs
|
|
Missing '-': changed "JDK 8284851" to JDK-8284851.
…________________________________
From: TheShermanTanker ***@***.***>
Sent: Tuesday, June 28, 2022 4:12 AM
To: openjdk/jdk ***@***.***>
Cc: Mark Powers ***@***.***>; Mention ***@***.***>
Subject: [External] : Re: [openjdk/jdk] JDK 8284851 Update javax.crypto files to use proper javadoc for mentioned classes (PR #9282)
@mcpowers<https://urldefense.com/v3/__https://github.com/mcpowers__;!!ACWV5N9M2RV99hQ!J4f6TfiCEgjKE5PychE69_uOAeR5Jj8_vsJ3yevJkPu-KnxHbEH6OXpgeQwmZeqhuLvlb_QC9jcFOHE7QQiI9W3dwg$> Seems like Skara didn't correctly detect and link the JBS entry. Try renaming your title to just "8284851" and see if that works (It may take a while)
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/9282*issuecomment-1168584208__;Iw!!ACWV5N9M2RV99hQ!J4f6TfiCEgjKE5PychE69_uOAeR5Jj8_vsJ3yevJkPu-KnxHbEH6OXpgeQwmZeqhuLvlb_QC9jcFOHE7QQiKpQMjYw$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AXVTFJQVNTVQ36CCP32XCS3VRLM2TANCNFSM5ZYM4SZA__;!!ACWV5N9M2RV99hQ!J4f6TfiCEgjKE5PychE69_uOAeR5Jj8_vsJ3yevJkPu-KnxHbEH6OXpgeQwmZeqhuLvlb_QC9jcFOHE7QQiutUTZgQ$>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
| * it in an AccessControlContext object, which it returns. A sample call is | ||
| * the following: | ||
| * it in an {@code AccessControlContext} object, which it returns. | ||
| A sample call is the following: |
|
|
||
| /** | ||
| * Constructs a AEADBadTagException with no detail message. | ||
| * Constructs an <code>AEADBadTagException</code> with no detail message. |
There was a problem hiding this comment.
I started with java.crypto first, and the first few files I looked at had <code> so I used <code>. I later realized there was a mix of styles. I tried to continue with whatever style a file was using.
|
|
||
| /** | ||
| * Constructs a AEADBadTagException with the specified | ||
| * Constructs an <code>AEADBadTagException</code> with the specified |
|
|
||
| /** | ||
| * Constructs a BadPaddingException with no detail | ||
| * Constructs a <code>BadPaddingException</code> with no detail |
|
|
||
| /** | ||
| * Constructs a BadPaddingException with the specified | ||
| * Constructs a <code>BadPaddingException</code> with the specified |
|
|
||
| /** | ||
| * Constant used to initialize cipher to encryption mode. | ||
| * Constant used to initialize {@code Cipher} to encryption mode. |
There was a problem hiding this comment.
If it's lower case, we normally just leave it? Not sure what is the criteria for changing this. Is it because these are public static constants, so you prefer more formatting? But then, some have "object" following the {@code Cipher}, and some aren't which looks a bit inconsistent.
There was a problem hiding this comment.
Personally, I'd against making this change, i.e. changing all "cipher" occurrences to "{@code Cipher}". Can we just stick to fixing what's broken?
There was a problem hiding this comment.
In this case the sentence was about initializing a cipher object, so I changed it to {@code Cipher}. If a sentence says "cipher block size" then I tried to leave it alone because it's referring to an algorithm rather than a class or object. I could add "object" after {@code Cipher} if it's not present. That would make it more consistent.
There was a problem hiding this comment.
Ok, add object afterwards would make it more consistent.
There was a problem hiding this comment.
fixed: {@code Cipher} object
| * underlying InputStream but have been additionally processed by the | ||
| * Cipher. The Cipher must be fully initialized before being used by | ||
| * a CipherInputStream. | ||
| * A <code>CipherInputStream</code> is composed of an <code>InputStream</code> |
There was a problem hiding this comment.
Use {@code }? Applies to the rest of changes of this file.
| * that write() methods first process the data before writing them out | ||
| * to the underlying OutputStream. The cipher must be fully | ||
| * initialized before being used by a CipherOutputStream. | ||
| * A <code>CipherOutputStream</code> is composed of an <code>OutputStream</code> |
There was a problem hiding this comment.
Use {@code } for all of the javadoc in this class?
| * <code>OutputStream</code> and a <code>Cipher</code>. | ||
| * <br>Note: if the specified output stream or cipher is | ||
| * null, a NullPointerException may be thrown later when | ||
| * <code>null</code>, a NullPointerException may be thrown later when |
| * This has the effect of constructing a <code>CipherOutputStream</code> | ||
| * using a <code>NullCipher</code>. | ||
| * <br>Note: if the specified output stream is <code>null</code>, a | ||
| * NullPointerException may be thrown later when it is used. |
|
|
||
| /** | ||
| * Sets the mode of this cipher. | ||
| * Sets the mode of this {@code Cipher}. |
There was a problem hiding this comment.
Same comment as in the one in Cipher.java, prefer to leave cipher alone.
There was a problem hiding this comment.
I believe we're doing {@code Cipher} object.
| * | ||
| * @return true if the specified permission is an | ||
| * instance of CryptoPermission. | ||
| * instance of <code>CryptoPermission</code>. |
There was a problem hiding this comment.
Use {@code } for all of the javadoc in this class?
| @@ -980,21 +982,22 @@ public static <T> T doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action | |||
| /** | |||
| * Returns the "inherited" AccessControl context. This is the context | |||
There was a problem hiding this comment.
Not sure what "AccessControl context" is. Either "access control context" or "{@code AccessControlContext}".
There was a problem hiding this comment.
using {@code AccessControlContext}
| * This method takes a "snapshot" of the current calling context, which | ||
| * includes the current Thread's inherited AccessControlContext and any | ||
| * limited privilege scope, and places it in an AccessControlContext object. | ||
| * includes the current Thread's inherited {@code AccessControlContext} |
There was a problem hiding this comment.
Fixed in this file and a couple of others.
| * getPermission method of the AccessControlException returns the | ||
| * {@code perm} Permission object instance. | ||
| * {@code getPermission} method of the AccessControlException returns the | ||
| * {@code perm} {@code Permission} object instance. |
| * the current AccessControlContext and security policy. | ||
| * the current {@code AccessControlContext} and security policy. | ||
| * This method quietly returns if the access request | ||
| * is permitted, or throws an AccessControlException otherwise. The |
There was a problem hiding this comment.
Want to code-ify "AccessControlException" as well?
| * AlgorithmParameterGeneratorSpi implementation from the first | ||
| * A new {@code AlgorithmParameterGenerator} object encapsulating the | ||
| * {@code AlgorithmParameterGeneratorSpi} implementation from the first | ||
| * Provider that supports the specified algorithm is returned. |
There was a problem hiding this comment.
"Provider" -> "provider".
| @@ -1031,7 +1031,7 @@ static String[] getFilterComponents(String filterKey, String filterValue) { | |||
| * algorithms or types for the specified Java cryptographic service | |||
| * (e.g., Signature, MessageDigest, Cipher, Mac, KeyStore). Returns | |||
| * an empty Set if there is no provider that supports the | |||
| * (e.g., Signature, MessageDigest, Cipher, Mac, KeyStore). Returns | ||
| * an empty Set if there is no provider that supports the | ||
| * specified service or if serviceName is null. For a complete list | ||
| * specified service or if serviceName is {@code null}. For a complete list |
| @@ -1031,7 +1031,7 @@ static String[] getFilterComponents(String filterKey, String filterValue) { | |||
| * algorithms or types for the specified Java cryptographic service | |||
| * (e.g., Signature, MessageDigest, Cipher, Mac, KeyStore). Returns | |||
There was a problem hiding this comment.
All these Java cryptographic service type names.
| * Thus, an {@code UnresolvedPermission} is essentially a "placeholder" | ||
| * containing information about the permission. | ||
| * | ||
| * <p>Later, when code calls AccessController.checkPermission |
There was a problem hiding this comment.
AccessController.checkPermission. Maybe make it a link.
| * @param obj the object we are testing for equality with this object. | ||
| * | ||
| * @return true if obj is an UnresolvedPermission, and has the same | ||
| * @return true if obj is an {@code UnresolvedPermission}, and has the same |
| * Returns a string describing this CryptoPermission. The convention is to | ||
| * specify the class name, the algorithm name, the maximum allowable | ||
| * key size, and the name of the exemption mechanism, in the following | ||
| * Returns a string describing this {@code CryptoPermission}. |
| * A CryptoPermissionCollection stores a set of CryptoPermission | ||
| * permissions. | ||
| * A {@code CryptoPermissionCollection} stores a set of | ||
| * {@code CryptoPermission} permissions. |
There was a problem hiding this comment.
Use objects instead of permissions for consistency's sake?
| * format: '("ClassName" "algorithm" "keysize" "exemption_mechanism")'. | ||
| * | ||
| * @return information about this CryptoPermission. | ||
| * @return information about this {@code CryptoPermission}. |
| /** | ||
| * A CryptoPermissionCollection stores a set of CryptoPermission | ||
| * permissions. | ||
| * A {@code CryptoPermissionCollection} stores a set of |
|
|
||
| /** | ||
| * Adds a permission to the CryptoPermissionCollection. | ||
| * Adds a permission to the {@code CryptoPermissionCollection}. |
| * | ||
| * @return true if the given permission is implied by this | ||
| * CryptoPermissionCollection, false if not. | ||
| * @return {@code true} if the given permission is implied by this |
There was a problem hiding this comment.
redundant space between permission and is?
| /** | ||
| * This class contains CryptoPermission objects, organized into | ||
| * This class contains {@code CryptoPermission} objects, organized into | ||
| * PermissionCollections according to algorithm names. |
There was a problem hiding this comment.
There is no PermissionCollections class. So, this should probably be changed to "{@code PermissionCollection} objects.
| /** | ||
| * Populates the crypto policy from the specified | ||
| * InputStream into this CryptoPermissions object. | ||
| * InputStream into this {@code CryptoPermissions} object. |
| * @param permission the Permission object to check. | ||
| * @param permission the {@code Permission} object to check. | ||
| * | ||
| * @return true if "permission" is implied by the permissions |
| * | ||
| * @return true if "permission" is implied by the permissions | ||
| * in the PermissionCollection it belongs to, false if not. | ||
| * in the {@code PermissionCollection} it belongs to, false if not. |
| * | ||
| * @return an enumeration of all the Permissions. | ||
| * Returns an enumeration of all the {@code Permission} objects | ||
| * in all the PermissionCollections in this |
There was a problem hiding this comment.
There is no PermissionCollections class. So, this should probably be changed to {@code PermissionCollection} objects. However, the sentence seems long and a bit hard to parse. Do you think we really need the middle part, i.e. "in all the PermissionCollection objects"?
There was a problem hiding this comment.
I don't think we need the middle part. Nothing is lost by removing it.
| * Processes {@code input.remaining()} bytes in the ByteBuffer | ||
| * {@code input}, starting at {@code input.position()}. |
| * confidentiality with a cryptographic algorithm. | ||
| * | ||
| * <p> Given any Serializable object, one can create a SealedObject | ||
| * <p> Given any Serializable object, one can create a {@code SealedObject} |
| * encoded in the default format. | ||
| * <p> | ||
| * That is, <code>cipher.getParameters().getEncoded()</code>. | ||
| * That is, {@code cipher.getParameters().getEncoded()}. |
|
|
||
| /** | ||
| * Constructs a SealedObject from any Serializable object. | ||
| * Constructs a {@code SealedObject} from any Serializable object. |
| /** | ||
| * Constructs a SealedObject object from the passed-in SealedObject. | ||
| * Constructs a <code>SealedObject</code> object from the passed-in | ||
| * SealedObject. |
There was a problem hiding this comment.
How about the SealedObject on line 195?
| * the sealing operation. | ||
| * If the default provider package provides an implementation of that | ||
| * algorithm, an instance of Cipher containing that implementation is used. | ||
| * algorithm, an instance of {@code Cipher} object containing that |
There was a problem hiding this comment.
"an instance of" seems redundant now that you added "object"
| * @return a new PermissionCollection object suitable for | ||
| * storing CryptoAllPermissions. | ||
| * @return a new {@code PermissionCollection} object suitable for | ||
| * storing {@code CryptoAllPermissions} objects. |
There was a problem hiding this comment.
typo: CryptoAllPermissions -> CryptoAllPermission?
|
|
||
| /** | ||
| * Create an empty CryptoAllPermissions object. | ||
| * Create an empty {@code CryptoAllPermission} object. |
There was a problem hiding this comment.
typo: CryptoAllPermissions -> CryptoAllPermission?
There was a problem hiding this comment.
It's already fixed.
valeriepeng
left a comment
There was a problem hiding this comment.
Ok with the changes under javax.crypto package.
|
/integrate |
|
/sponsor |
|
Going to push as commit f804f2c.
Your commit was automatically rebased without conflicts. |
|
@valeriepeng @mcpowers Pushed as commit f804f2c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
https://bugs.openjdk.org/browse/JDK-8284851
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9282/head:pull/9282$ git checkout pull/9282Update a local copy of the PR:
$ git checkout pull/9282$ git pull https://git.openjdk.org/jdk pull/9282/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9282View PR using the GUI difftool:
$ git pr show -t 9282Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9282.diff