From 522c7b446fef17a8400bc589c55b161e939770cc Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 13 May 2025 08:10:11 +0000 Subject: [PATCH] 8356175: Remove unnecessary Map.get from XWM.getInsets Reviewed-by: tr, aivanov, serb --- src/java.desktop/unix/classes/sun/awt/X11/XWM.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XWM.java b/src/java.desktop/unix/classes/sun/awt/X11/XWM.java index 093479b999e..a30dc5d5c76 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XWM.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XWM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1738,9 +1738,7 @@ final class XWM correctWM.left = win.scaleUp(correctWM.left); correctWM.right = win.scaleUp(correctWM.right); - if (storedInsets.get(win.getClass()) == null) { - storedInsets.put(win.getClass(), correctWM); - } + storedInsets.putIfAbsent(win.getClass(), correctWM); return correctWM; } boolean isDesktopWindow( long w ) {