RFR: 8175874: Update Security.insertProviderAt to specify behavior when requested position is out of range. [v4]

Sean Mullan mullan at openjdk.org
Thu Aug 17 21:48:29 UTC 2023


On Thu, 17 Aug 2023 18:33:09 GMT, Ben Perez <duke at openjdk.org> wrote:

>> Fixing the bug as stated would cause compatibility issues. E.g. the `addProvider` function always adds new providers at position 0 and therefore would always throw an error. Instead of changing how the function handles indices, we instead have added this behavior to the function spec.
>
> Ben Perez has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Changed function spec wording, updated test

test/jdk/java/security/Provider/ChangeProviders.java line 85:

> 83: 
> 84:         //Ensure that providers inserted at position 0 or > n are placed
> 85:         //at the n+1st position

It's probably clearer to reset n after this and then test for n+1 instead of n+2, ex - add a line:


// reset n to number of installed providers
n = plen();

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14925#discussion_r1297781990



More information about the security-dev mailing list