RFR: 4964430: (spec) missing IllegalStateException exception requirement for javax.crypto.Cipher.doFinal [v4]

Ferenc Rakoczi duke at openjdk.org
Thu Oct 5 15:20:26 UTC 2023


On Thu, 5 Oct 2023 14:29:35 GMT, Sean Mullan <mullan at openjdk.org> wrote:

>> Ben Perez has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated docs for NullCipher to indicate it will not throw and IllegalStateException when calling Cipher methods in bad state
>
> src/java.base/share/classes/javax/crypto/NullCipher.java line 35:
> 
>> 33:  * byte.  Unlike other ciphers, the {@code NullCipher} will not throw an
>> 34:  * {@code IllegalStateException} when calling {@code Cipher} methods
>> 35:  * in an incorrect state.
> 
> Suggest rewording last part as "... when {@code Cipher} methods are called in an incorrect state." I also think we should say a NullCipher has no state. So how about:
> 
> "Unlike other ciphers, the {@code NullCipher} has no state, and will not throw an {@code IllegalStateException} when {@code Cipher} methods are called in an incorrect state."

Well, if it has no state it cannot be in an incorrect state so the " in an incorrect state" part can be omitted.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15727#discussion_r1347596323



More information about the security-dev mailing list