RFR: 8344064: Remove doPrivileged calls from print/imageio/media classes in the java.desktop module [v2]

Phil Race prr at openjdk.org
Wed Nov 20 18:48:20 UTC 2024


On Tue, 19 Nov 2024 21:45:31 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8344064
>
> src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java line 2042:
> 
>> 2040:     private static boolean isLinkedProfileAllowed() {
>> 2041:         if (isLinkedProfileAllowed == null) {
>> 2042:             isLinkedProfileAllowed = Boolean.getBoolean("sun.imageio.bmp.enableLinkedProfiles");
> 
> Do we even need that static variable? Why not just
> `return Boolean.getBoolean("sun.imageio.bmp.enableLinkedProfiles");`
> Performance? Does it deserve an internal caching? Just curious.

Fairly standard practice to cache the results of such calls.
Changing it in this PR would have to be for a very good reason.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22186#discussion_r1850812563


More information about the client-libs-dev mailing list