RFR: 8209038: Clarify the javadoc of Cipher.getParameters()

Valerie Peng valeriep at openjdk.java.net
Tue Apr 12 03:37:44 UTC 2022


On Mon, 11 Apr 2022 15:20:22 GMT, Sean Mullan <mullan at openjdk.org> wrote:

>> Anyone can help review this javadoc update? The main change is the wording for the method javadoc of Cipher.getParameters()/CipherSpi.engineGetParameters(). The original wording is somewhat restrictive and request is to broaden this to accommodate more scenarios such as when null can be returned.
>> The rest are minor things like add {@code } to class name and null, and remove redundant ".". 
>> 
>> Will file CSR after the review is close to being wrapped up.
>> Thanks~
>
> src/java.base/share/classes/javax/crypto/Cipher.java line 488:
> 
>> 486:      * A new {@code Cipher} object encapsulating the
>> 487:      * {@code CipherSpi} implementation from the first
>> 488:      * Provider that supports the specified algorithm is returned.
> 
> Since "Provider" is capitalized, I think the intent was that this was the classname, so it should also probably be in an `@code` tag. Alternatively, you could change this to non-capitalized "provider" (w/o the @code tag) and I think it would still be readable (and my vote would be for this).

Sure, I will use the non-capitalized "provider" whenever suitable. For some cases, there are "provider" argument, so it looks that {@code provider} is more suitable.

> src/java.base/share/classes/javax/crypto/Cipher.java line 655:
> 
>> 653:      *
>> 654:      * <p> A new {@code Cipher} object encapsulating the
>> 655:      * {@code CipherSpi} implementation from the specified Provider
> 
> Since `Provider` here is a parameter, it is probably better to put this in an `@code` tag.

Yes, I will use the {@code provider} for the "provider" parameter.

> src/java.base/share/classes/javax/crypto/Cipher.java line 2641:
> 
>> 2639:      *
>> 2640:      * @param transformation the cipher transformation
>> 2641:      * @return the maximum key length in bits or Integer.MAX_VALUE
> 
> Integer.MAX_VALUE should be inside a `@code` tag.

Ok.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8117


More information about the security-dev mailing list