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 ) {