RFR: 8373101: JdkClient and JdkServer test classes ignore namedGroups field

Mikhail Yankelevich myankelevich at openjdk.org
Tue Dec 9 15:22:24 UTC 2025


On Thu, 4 Dec 2025 18:50:19 GMT, Matthew Donovan <mdonovan at openjdk.org> wrote:

> This PR updates a couple test utility classes, JdkClient and JdkServer. Theseclasses extend AbstractPeer which contains a `namedGroup` field however, when creating/configuring the objects, the field is ignored. This PR just makes sure to include named groups if they are specified.

test/jdk/javax/net/ssl/TLSCommon/interop/JdkClient.java line 92:

> 90:         if (builder.getNamedGroups() != null
> 91:                 && builder.getNamedGroups().length > 0) {
> 92:             NamedGroup[] namedGroups = builder.getNamedGroups();

Minor: Do you think moving it outside of the if statement and making the if statement call `namedGroups` directly might be a bit easier to read?  Otherwise you're calling the same action 3 times in a row

test/jdk/javax/net/ssl/TLSCommon/interop/JdkClient.java line 96:

> 94:             for (int i = 0 ; i < namedGroups.length ; ++i) {
> 95:                 namedGroupStrs[i] = namedGroups[i].name;
> 96:             }

nit:  what do you think? 
```suggestion 
String[] namedGroupStrs = Arrays.stream(namedGroups)
                         .map(NamedGroup::name)
                         .toArray(String[]::new);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28664#discussion_r2603085845
PR Review Comment: https://git.openjdk.org/jdk/pull/28664#discussion_r2603111718


More information about the security-dev mailing list