On Wed, 28 Aug 2024 08:54:39 GMT, Abhishek Kumar <[email protected]> wrote:

> `static final Map<String,GTKStockIcon> ICONS_MAP` is modified only in 
> `static` block. Then 
> [com.sun.java.swing.plaf.gtk.GTKStyle#get](https://github.com/kumarabhi006/jdk/blob/73f7a5f15dbba54a98f3916ff1190520ac07874d/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java#L892)
>  method read from it within `synchronized (ICONS_MAP)` block. As this map is 
> read-only and all its content is initialized in static block we can safely 
> remove synchronized from get call.

This pull request has now been integrated.

Changeset: 5998f4b6
Author:    Abhishek Kumar <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/5998f4b6f53769f98188ae8c23ea49cc1f7aa802
Stats:     21 lines in 1 file changed: 1 ins; 4 del; 16 mod

8308588: Unnecessary synchronized on GTKStyle#ICONS_MAP can be removed

Reviewed-by: tr, aivanov, aturbanov

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

PR: https://git.openjdk.org/jdk/pull/20741

Reply via email to