RFR: 8362658: sun/security/ssl/SSLEngineImpl/* tests duplicate jvm flags [v2]
Neha Joshi
duke at openjdk.org
Thu Nov 20 16:50:14 UTC 2025
> In this PR we have updated the code to remove the duplicate call and ensure JVM flags are added only once.
>
> ### ISSUE :-
> In the test case --> ProcessTools.createTestJavaProcessBuilder(Utils.addTestJavaOpts("SSLEngineKeyLimit", "p", args[1], args[2]));
>
> -> Before executing ProcessTools.createTestJavaProcessBuilder() we are calling ---> Utils.addTestJavaOpts() which internally call prependTestJavaOpts();
>
>> public static String[] addTestJavaOpts(String... userArgs) {
>> return prependTestJavaOpts(userArgs);
>> }
>
> -> Then again inside ProcessTools.createTestJavaProcessBuilder() method we are calling Utils.prependTestJavaOpts()
>
>> public static ProcessBuilder createTestJavaProcessBuilder(String... command) {
>> return createJavaProcessBuilder(Utils.prependTestJavaOpts(command));
>> }
>
>
> Calling Utils.prependTestJavaOpts() twice leads to duplicate JVM flags (This method call-> getTestJavaOpts() the main reason for duplication and below is the implementation for the same. )
>
>> public static String[] getTestJavaOpts() {
>> List<String> opts = new ArrayList<String>();
>> Collections.addAll(opts, safeSplitString(VM_OPTIONS));
>> Collections.addAll(opts, safeSplitString(JAVA_OPTIONS));
>> return opts.toArray(new String[0]);
>> }
>
> Contributed-by: @Korov
> https://github.com/openjdk/jdk/pull/26404
>
> https://bugs.openjdk.org/browse/JDK-8362658
Neha Joshi has updated the pull request incrementally with one additional commit since the last revision:
JDK-8362658 : Reformat code to comply with 80-character line length limit
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28428/files
- new: https://git.openjdk.org/jdk/pull/28428/files/3b6c8d4a..60bc1d76
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28428&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28428&range=00-01
Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/28428.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28428/head:pull/28428
PR: https://git.openjdk.org/jdk/pull/28428
More information about the security-dev
mailing list