RFR: 8267068: Incomplete @throws javadoc for various javax.crypto.spec classes
Valerie Peng
valeriep at openjdk.org
Wed Feb 12 21:12:16 UTC 2025
On Wed, 12 Feb 2025 18:37:38 GMT, Valerie Peng <valeriep at openjdk.org> wrote:
>> src/java.base/share/classes/javax/crypto/spec/IvParameterSpec.java line 73:
>>
>>> 71: * or {@code (iv.length - offset < len)}
>>> 72: * @throws ArrayIndexOutOfBoundsException if {@code offset}
>>> 73: * or {@code len} index bytes outside the {@code iv}.
>>
>> can you fix this grammatical issue while you are changing this:
>>
>> s/outside/are outside/
>
> Maybe we should just state that ArrayIndexOutOfBoundsException is thrown if `offset` or `len` is negative? The current wording for AIOOBE seems to suggest that it covers the case when `offset` or `len` is too large. But that is covered by the IAE.
`SecretKeySpec` constructor has this same wording for AIOOBE, so if we change to cover negative value only, we should apply the same change to `SecretKeySpec` as well.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23188#discussion_r1953217127
More information about the security-dev
mailing list