8382487: Remove unnecessary SuppressWarnings annotations in java.desktop

Reviewed-by: serb, aivanov, dmarkov
This commit is contained in:
Phil Race 2026-04-21 18:57:39 +00:00
parent 97ccabb28e
commit 16ad67e6da
8 changed files with 3 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2026, 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
@ -48,7 +48,6 @@ public class StreamCloser {
private static WeakHashMap<CloseAction, Object> toCloseQueue;
private static Thread streamCloser;
@SuppressWarnings("removal")
public static void addToQueue(CloseAction ca) {
synchronized (StreamCloser.class) {
if (toCloseQueue == null) {

View File

@ -4000,7 +4000,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
* {@code true}.
* @see #createBuffers(int, BufferCapabilities)
*/
@SuppressWarnings("removal")
protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
throws AWTException
{
@ -8129,7 +8128,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
return res;
}
@SuppressWarnings("removal")
final Component getNextFocusCandidate() {
Container rootAncestor = getTraversalRoot();
Component comp = this;

View File

@ -55,7 +55,6 @@ class SequencedEvent extends AWTEvent implements ActiveEvent {
private static final LinkedList<SequencedEvent> list = new LinkedList<>();
private final AWTEvent nested;
@SuppressWarnings("serial") // Not statically typed as Serializable
private boolean disposed;
private final LinkedList<AWTEvent> pendingEvents = new LinkedList<>();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2026, 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
@ -718,7 +718,6 @@ class SubRegistry {
this.category = category;
}
@SuppressWarnings("removal")
public synchronized boolean registerServiceProvider(Object provider) {
Object oprovider = map.get(provider.getClass());
boolean present = oprovider != null;

View File

@ -5070,7 +5070,6 @@ public abstract class JComponent extends Container implements Serializable,
this.paintingChild = paintingChild;
}
@SuppressWarnings("removal")
void _paintImmediately(int x, int y, int w, int h) {
Graphics g;
Container c;

View File

@ -865,7 +865,6 @@ public class PopupFactory {
/**
* Returns the cache to use for medium weight popups.
*/
@SuppressWarnings("unchecked")
private static List<MediumWeightPopup> getMediumWeightPopupCache() {
synchronized (MediumWeightPopup.class) {
if (cache == null) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2026, 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
@ -818,7 +818,6 @@ public final class ToolTipManager extends MouseAdapter implements MouseMotionLis
// Returns: 0 no adjust
// >0 adjust by value return
@SuppressWarnings("removal")
private int getPopupFitHeight(Rectangle popupRectInScreen, Component invoker){
if (invoker != null){
Container parent;

View File

@ -108,7 +108,6 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
static List<WWindowPeer> activeWindows = new LinkedList<WWindowPeer>();
// WComponentPeer overrides
@Override
@SuppressWarnings("unchecked")
protected void disposeImpl() {
synchronized (activeWindows) {
activeWindows.remove(this);