RFR: 8360463: Ambiguity in Cipher.getInstance() specification between NoSuchAlgorithmException and NoSuchPaddingException [v8]

Valerie Peng valeriep at openjdk.org
Thu Sep 18 20:43:41 UTC 2025


On Thu, 18 Sep 2025 20:20:25 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   updated the checkTransformation() method w/ specific provider and
>>   exception per Sean's suggestion
>
> src/java.base/share/classes/javax/crypto/Cipher.java line 507:
> 
>> 505:      *
>> 506:      * @throws NoSuchAlgorithmException if {@code transformation}
>> 507:      *         is {@code null}, empty, in an invalid format,
> 
> Not related to this change, but do we need an "or" before "in an valid format"?

Hmm, how about this?

@throws NoSuchAlgorithmException if {@code transformation}
        is {@code null}, empty or in an invalid format,
        or if a {@code CipherSpi} implementation is not found or
        is found but does not support the mode

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26489#discussion_r2361142493


More information about the security-dev mailing list