On Tue, 7 Jul 2026 05:55:38 GMT, Hai-May Chao <[email protected]> wrote:
>> test/jdk/java/security/Signature/TestLegacyAlgorithms.java line 138:
>>
>>> 136: for (Provider p : providers) {
>>> 137: for (String a : ALG_LIST) {
>>> 138: checkWarn("provider object " + p.getName() + ": alg "
>>> + a,
>>
>> Have you tested this when there is more than one provider that supports the
>> legacy algorithm? It seems that the warning would only be emitted once for
>> the first provider, since it is the same caller when the 2nd provider is
>> used.
>
> I have not observed a real multiple providers case within this one othervm
> run. Since the second provider should not warn for the same caller and
> algorithm in the same JVM, I changed the test to use the first provider to
> verify warning emission. This would verify the API that emits warning once
> per caller for each legacy algorithm (not by provider), and also eliminate
> the original misleading one warning per provider test.
The SunPKCS11 provider would typically have additional implementations of the
algorithms you are testing, but that usually requires some configuration in
order for that provider to be loaded, ex - on Linux systems. So I think your
change is ok and will guard against future algorithms implementations that may
be added.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31472#discussion_r3538484736