RFR: 8366101: Replace the use of ThreadTracker with ScopedValue in java.util.jar.JarFile [v2]
Chen Liang
liach at openjdk.org
Tue Dec 2 23:44:52 UTC 2025
On Tue, 2 Dec 2025 20:08:54 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> src/java.base/share/classes/java/util/jar/JarFile.java line 1047:
>>
>>> 1045: jvInitialized = true;
>>> 1046: }
>>> 1047: });
>>
>> You can consider shortening this using a lambda:
>>
>>
>> ScopedValue.where(IN_VERIFIER_INIT, true).run(() -> {
>> initializeVerifier();
>> jvInitialized = true;
>> });
>
> Yes, but I think would be prudent to run startup benchmarks if you change that.
Using a lambda is probably fine given the AOT cache can archive lambdas and avoid the bytecode generation cost.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28609#discussion_r2583136671
More information about the security-dev
mailing list