8343476: Remove unnecessary @SuppressWarnings annotations (client)

Reviewed-by: prr
This commit is contained in:
Archie Cobbs 2024-11-20 01:57:03 +00:00
parent 4ddd3dec2d
commit 8a1f9f0a32
107 changed files with 95 additions and 252 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -142,7 +142,6 @@ public final class SampleTree {
/** Constructs a JPanel containing check boxes for the different /** Constructs a JPanel containing check boxes for the different
* options that tree supports. */ * options that tree supports. */
@SuppressWarnings("serial")
private JPanel constructOptionsPanel() { private JPanel constructOptionsPanel() {
JCheckBox aCheckbox; JCheckBox aCheckbox;
JPanel retPanel = new JPanel(false); JPanel retPanel = new JPanel(false);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -97,7 +97,6 @@ public class TableExample3 {
}; };
// Create a model of the data. // Create a model of the data.
@SuppressWarnings("serial")
TableModel dataModel = new AbstractTableModel() { TableModel dataModel = new AbstractTableModel() {
// These methods always need to be implemented. // These methods always need to be implemented.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -99,7 +99,6 @@ public class TableExample4 {
}; };
// Create a model of the data. // Create a model of the data.
@SuppressWarnings("serial")
TableModel dataModel = new AbstractTableModel() { TableModel dataModel = new AbstractTableModel() {
// These methods always need to be implemented. // These methods always need to be implemented.
@ -180,7 +179,6 @@ public class TableExample4 {
// Show the values in the "Favorite Number" column in different colors. // Show the values in the "Favorite Number" column in different colors.
TableColumn numbersColumn = tableView.getColumn("Favorite Number"); TableColumn numbersColumn = tableView.getColumn("Favorite Number");
@SuppressWarnings("serial")
DefaultTableCellRenderer numberColumnRenderer DefaultTableCellRenderer numberColumnRenderer
= new DefaultTableCellRenderer() { = new DefaultTableCellRenderer() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -63,7 +63,6 @@ class AquaComboBoxButton extends JButton {
boolean isPopDown; boolean isPopDown;
boolean isSquare; boolean isSquare;
@SuppressWarnings("serial") // anonymous class
protected AquaComboBoxButton(final AquaComboBoxUI ui, protected AquaComboBoxButton(final AquaComboBoxUI ui,
final JComboBox<Object> comboBox, final JComboBox<Object> comboBox,
final CellRendererPane rendererPane, final CellRendererPane rendererPane,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -161,7 +161,6 @@ final class AquaComboBoxPopup extends BasicComboPopup {
} }
@Override @Override
@SuppressWarnings("serial") // anonymous class
protected JList<Object> createList() { protected JList<Object> createList() {
return new JList<Object>(comboBox.getModel()) { return new JList<Object>(comboBox.getModel()) {
@Override @Override

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -230,7 +230,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
@SuppressWarnings("serial") // Superclass is not serializable across versions @SuppressWarnings("serial") // Superclass is not serializable across versions
class AquaCustomComboTextField extends JTextField { class AquaCustomComboTextField extends JTextField {
@SuppressWarnings("serial") // anonymous class
public AquaCustomComboTextField() { public AquaCustomComboTextField() {
final InputMap inputMap = getInputMap(); final InputMap inputMap = getInputMap();
inputMap.put(KeyStroke.getKeyStroke("DOWN"), highlightNextAction); inputMap.put(KeyStroke.getKeyStroke("DOWN"), highlightNextAction);
@ -350,7 +349,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
/** /**
* Highlight _but do not select_ the next item in the list. * Highlight _but do not select_ the next item in the list.
*/ */
@SuppressWarnings("serial") // anonymous class
private Action highlightNextAction = new ComboBoxAction() { private Action highlightNextAction = new ComboBoxAction() {
@Override @Override
public void performComboBoxAction(AquaComboBoxUI ui) { public void performComboBoxAction(AquaComboBoxUI ui) {
@ -367,7 +365,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
/** /**
* Highlight _but do not select_ the previous item in the list. * Highlight _but do not select_ the previous item in the list.
*/ */
@SuppressWarnings("serial") // anonymous class
private Action highlightPreviousAction = new ComboBoxAction() { private Action highlightPreviousAction = new ComboBoxAction() {
@Override @Override
void performComboBoxAction(final AquaComboBoxUI ui) { void performComboBoxAction(final AquaComboBoxUI ui) {
@ -380,7 +377,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
} }
}; };
@SuppressWarnings("serial") // anonymous class
private Action highlightFirstAction = new ComboBoxAction() { private Action highlightFirstAction = new ComboBoxAction() {
@Override @Override
void performComboBoxAction(final AquaComboBoxUI ui) { void performComboBoxAction(final AquaComboBoxUI ui) {
@ -389,7 +385,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
} }
}; };
@SuppressWarnings("serial") // anonymous class
private Action highlightLastAction = new ComboBoxAction() { private Action highlightLastAction = new ComboBoxAction() {
@Override @Override
void performComboBoxAction(final AquaComboBoxUI ui) { void performComboBoxAction(final AquaComboBoxUI ui) {
@ -399,7 +394,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
} }
}; };
@SuppressWarnings("serial") // anonymous class
private Action highlightPageUpAction = new ComboBoxAction() { private Action highlightPageUpAction = new ComboBoxAction() {
@Override @Override
void performComboBoxAction(final AquaComboBoxUI ui) { void performComboBoxAction(final AquaComboBoxUI ui) {
@ -420,7 +414,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
} }
}; };
@SuppressWarnings("serial") // anonymous class
private Action highlightPageDownAction = new ComboBoxAction() { private Action highlightPageDownAction = new ComboBoxAction() {
@Override @Override
void performComboBoxAction(final AquaComboBoxUI ui) { void performComboBoxAction(final AquaComboBoxUI ui) {
@ -560,7 +553,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
// This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that // This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that
// arrow up or down does not automatically select the // arrow up or down does not automatically select the
@SuppressWarnings("serial") // anonymous class
private final Action triggerSelectionAction = new AbstractAction() { private final Action triggerSelectionAction = new AbstractAction() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
triggerSelectionEvent((JComboBox)e.getSource(), e); triggerSelectionEvent((JComboBox)e.getSource(), e);
@ -572,7 +564,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
} }
}; };
@SuppressWarnings("serial") // anonymous class
private static final Action toggleSelectionAction = new AbstractAction() { private static final Action toggleSelectionAction = new AbstractAction() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
final JComboBox<?> comboBox = (JComboBox<?>) e.getSource(); final JComboBox<?> comboBox = (JComboBox<?>) e.getSource();
@ -591,7 +582,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
} }
}; };
@SuppressWarnings("serial") // anonymous class
private final Action hideAction = new AbstractAction() { private final Action hideAction = new AbstractAction() {
@Override @Override
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
@ -606,7 +596,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
} }
}; };
@SuppressWarnings("serial") // anonymous class
private final Action openPopupOrHighlightLast = new ComboBoxAction() { private final Action openPopupOrHighlightLast = new ComboBoxAction() {
@Override @Override
void performComboBoxAction(final AquaComboBoxUI ui) { void performComboBoxAction(final AquaComboBoxUI ui) {
@ -617,7 +606,6 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
} }
}; };
@SuppressWarnings("serial") // anonymous class
private final Action openPopupOrHighlightFirst = new ComboBoxAction() { private final Action openPopupOrHighlightFirst = new ComboBoxAction() {
@Override @Override
void performComboBoxAction(final AquaComboBoxUI ui) { void performComboBoxAction(final AquaComboBoxUI ui) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1240,7 +1240,6 @@ public class AquaFileChooserUI extends FileChooserUI {
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
} }
@SuppressWarnings("serial") // anonymous class
protected ListCellRenderer<File> createDirectoryComboBoxRenderer(final JFileChooser fc) { protected ListCellRenderer<File> createDirectoryComboBoxRenderer(final JFileChooser fc) {
return new AquaComboBoxRendererInternal<File>(directoryComboBox) { return new AquaComboBoxRendererInternal<File>(directoryComboBox) {
public Component getListCellRendererComponent(final JList<? extends File> list, public Component getListCellRendererComponent(final JList<? extends File> list,
@ -1356,7 +1355,6 @@ public class AquaFileChooserUI extends FileChooserUI {
// //
// Renderer for Types ComboBox // Renderer for Types ComboBox
// //
@SuppressWarnings("serial") // anonymous class
protected ListCellRenderer<FileFilter> createFilterComboBoxRenderer() { protected ListCellRenderer<FileFilter> createFilterComboBoxRenderer() {
return new AquaComboBoxRendererInternal<FileFilter>(filterComboBox) { return new AquaComboBoxRendererInternal<FileFilter>(filterComboBox) {
public Component getListCellRendererComponent(final JList<? extends FileFilter> list, public Component getListCellRendererComponent(final JList<? extends FileFilter> list,
@ -1611,7 +1609,6 @@ public class AquaFileChooserUI extends FileChooserUI {
tPanel.add(labelArea); tPanel.add(labelArea);
// separator line // separator line
@SuppressWarnings("serial") // anonymous class
final JSeparator sep = new JSeparator(){ final JSeparator sep = new JSeparator(){
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(((JComponent)getParent()).getWidth(), 3); return new Dimension(((JComponent)getParent()).getWidth(), 3);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,7 +39,6 @@ import com.apple.laf.AquaUtils.RecyclableSingleton;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
@SuppressWarnings("serial") // JDK implementation class
class AquaFileView extends FileView { class AquaFileView extends FileView {
private static final boolean DEBUG = false; private static final boolean DEBUG = false;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1020,7 +1020,6 @@ public class AquaTabbedPaneUI extends AquaTabbedPaneCopyFromBasicUI {
if (component == null) { if (component == null) {
menuItem = new JMenuItem(tabPane.getTitleAt(i), tabPane.getIconAt(i)); menuItem = new JMenuItem(tabPane.getTitleAt(i), tabPane.getIconAt(i));
} else { } else {
@SuppressWarnings("serial") // anonymous class
JMenuItem tmp = new JMenuItem() { JMenuItem tmp = new JMenuItem() {
public void paintComponent(final Graphics g) { public void paintComponent(final Graphics g) {
super.paintComponent(g); super.paintComponent(g);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -249,7 +249,6 @@ public class AquaTextFieldSearch {
label.setText(promptText); label.setText(promptText);
} }
@SuppressWarnings("serial") // anonymous class inside
protected static JButton getCancelButton(final JTextComponent c) { protected static JButton getCancelButton(final JTextComponent c) {
final JButton b = createButton(c, getCancelIcon()); final JButton b = createButton(c, getCancelIcon());
b.setName("cancel"); b.setName("cancel");
@ -326,7 +325,6 @@ public class AquaTextFieldSearch {
} }
protected boolean doingLayout; protected boolean doingLayout;
@SuppressWarnings("serial") // anonymous class inside
protected LayoutManager getCustomLayout() { protected LayoutManager getCustomLayout() {
// unfortunately, the default behavior of BorderLayout, which accommodates for margins // unfortunately, the default behavior of BorderLayout, which accommodates for margins
// is not what we want, so we "turn off margins" for layout for layout out our buttons // is not what we want, so we "turn off margins" for layout for layout out our buttons

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -254,7 +254,6 @@ final class LWListPeer extends LWComponentPeer<List, LWListPeer.ScrollableJList>
} }
@Override @Override
@SuppressWarnings("unchecked")
public void valueChanged(final ListSelectionEvent e) { public void valueChanged(final ListSelectionEvent e) {
if (!e.getValueIsAdjusting() && !isSkipStateChangedEvent()) { if (!e.getValueIsAdjusting() && !isSkipStateChangedEvent()) {
final JList<?> source = (JList<?>) e.getSource(); final JList<?> source = (JList<?>) e.getSource();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1353,7 +1353,6 @@ public class LWWindowPeer
changeFocusedWindow(activate, null); changeFocusedWindow(activate, null);
} }
@SuppressWarnings("deprecation")
private boolean isOneOfOwnersOf(LWWindowPeer peer) { private boolean isOneOfOwnersOf(LWWindowPeer peer) {
Window owner = (peer != null ? peer.getTarget().getOwner() : null); Window owner = (peer != null ? peer.getTarget().getOwner() : null);
while (owner != null) { while (owner != null) {

View File

@ -268,7 +268,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
} }
} }
}) { }) {
@SuppressWarnings("deprecation")
public CPlatformWindow convertJComponentToTarget(final JRootPane p) { public CPlatformWindow convertJComponentToTarget(final JRootPane p) {
Component root = SwingUtilities.getRoot(p); Component root = SwingUtilities.getRoot(p);
final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); final ComponentAccessor acc = AWTAccessor.getComponentAccessor();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -610,7 +610,6 @@ public class TIFFOldJPEGDecompressor extends TIFFJPEGDecompressor {
JPEGReader.read(0, JPEGParam); JPEGReader.read(0, JPEGParam);
} }
@SuppressWarnings("removal")
protected void finalize() throws Throwable { protected void finalize() throws Throwable {
super.finalize(); super.finalize();
JPEGReader.dispose(); JPEGReader.dispose();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -281,7 +281,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
fc.setLayout(new BorderLayout(10, 10)); fc.setLayout(new BorderLayout(10, 10));
fc.setAlignmentX(JComponent.CENTER_ALIGNMENT); fc.setAlignmentX(JComponent.CENTER_ALIGNMENT);
@SuppressWarnings("serial") // anonymous class
JPanel interior = new JPanel() { JPanel interior = new JPanel() {
public Insets getInsets() { public Insets getInsets() {
return insets; return insets;
@ -305,7 +304,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
curDirName = currentDirectory.getPath(); curDirName = currentDirectory.getPath();
} }
@SuppressWarnings("serial") // anonymous class
JTextField tmp1 = new JTextField(curDirName, 35) { JTextField tmp1 = new JTextField(curDirName, 35) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize(); Dimension d = super.getMaximumSize();
@ -341,7 +339,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
align(l); align(l);
leftPanel.add(l); leftPanel.add(l);
@SuppressWarnings("serial") // anonymous class
JComboBox<FileFilter> tmp2 = new JComboBox<FileFilter>() { JComboBox<FileFilter> tmp2 = new JComboBox<FileFilter>() {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize(); Dimension d = super.getMaximumSize();
@ -419,7 +416,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
align(fileNameLabel); align(fileNameLabel);
interior.add(fileNameLabel); interior.add(fileNameLabel);
@SuppressWarnings("serial") // anonymous class
JTextField tmp3 = new JTextField(35) { JTextField tmp3 = new JTextField(35) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize(); Dimension d = super.getMaximumSize();
@ -444,7 +440,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS)); buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
buttonPanel.add(Box.createGlue()); buttonPanel.add(Box.createGlue());
@SuppressWarnings("serial") // anonymous class
JButton tmp4 = new JButton(getApproveButtonText(fc)) { JButton tmp4 = new JButton(getApproveButtonText(fc)) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height); return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
@ -460,7 +455,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
buttonPanel.add(approveButton); buttonPanel.add(approveButton);
buttonPanel.add(Box.createGlue()); buttonPanel.add(Box.createGlue());
@SuppressWarnings("serial") // anonymous class
JButton updateButton = new JButton(updateButtonText) { JButton updateButton = new JButton(updateButtonText) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height); return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
@ -475,7 +469,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
buttonPanel.add(updateButton); buttonPanel.add(updateButton);
buttonPanel.add(Box.createGlue()); buttonPanel.add(Box.createGlue());
@SuppressWarnings("serial") // anonymous class
JButton cancelButton = new JButton(cancelButtonText) { JButton cancelButton = new JButton(cancelButtonText) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height); return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
@ -490,7 +483,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
buttonPanel.add(cancelButton); buttonPanel.add(cancelButton);
buttonPanel.add(Box.createGlue()); buttonPanel.add(Box.createGlue());
@SuppressWarnings("serial") // anonymous class
JButton helpButton = new JButton(helpButtonText) { JButton helpButton = new JButton(helpButtonText) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height); return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -132,7 +132,6 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
} }
} }
@SuppressWarnings("serial") // anonymous class
protected void setupMenuOpenKey(){ protected void setupMenuOpenKey(){
super.setupMenuOpenKey(); super.setupMenuOpenKey();
ActionMap map = SwingUtilities.getUIActionMap(frame); ActionMap map = SwingUtilities.getUIActionMap(frame);
@ -152,7 +151,6 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
} }
} }
@SuppressWarnings("serial") // anonymous class
protected void setupMenuCloseKey(){ protected void setupMenuCloseKey(){
ActionMap map = SwingUtilities.getUIActionMap(frame); ActionMap map = SwingUtilities.getUIActionMap(frame);
if (map != null) { if (map != null) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -72,7 +72,6 @@ public class MotifOptionPaneUI extends BasicOptionPaneUI
return null; return null;
} }
@SuppressWarnings("serial") // anonymous class
protected Container createSeparator() { protected Container createSeparator() {
return new JPanel() { return new JPanel() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -57,7 +57,7 @@ import javax.sound.sampled.UnsupportedAudioFileException;
* @author Arthur van Hoff, Kara Kytle, Jan Borgersen * @author Arthur van Hoff, Kara Kytle, Jan Borgersen
* @author Florian Bomers * @author Florian Bomers
*/ */
@SuppressWarnings({"deprecation", "removal"}) @SuppressWarnings("removal")
public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener { public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener {
private long lastPlayCall = 0; private long lastPlayCall = 0;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -625,7 +625,6 @@ public class AWTEventMulticaster implements
* @return the resulting listener * @return the resulting listener
* @since 1.4 * @since 1.4
*/ */
@SuppressWarnings("overloads")
public static WindowStateListener add(WindowStateListener a, public static WindowStateListener add(WindowStateListener a,
WindowStateListener b) { WindowStateListener b) {
return (WindowStateListener)addInternal(a, b); return (WindowStateListener)addInternal(a, b);
@ -828,7 +827,6 @@ public class AWTEventMulticaster implements
* @return the resulting listener * @return the resulting listener
* @since 1.4 * @since 1.4
*/ */
@SuppressWarnings("overloads")
public static WindowStateListener remove(WindowStateListener l, public static WindowStateListener remove(WindowStateListener l,
WindowStateListener oldl) { WindowStateListener oldl) {
return (WindowStateListener) removeInternal(l, oldl); return (WindowStateListener) removeInternal(l, oldl);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -7415,7 +7415,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
} }
final Set<AWTKeyStroke> getFocusTraversalKeys_NoIDCheck(int id) { final Set<AWTKeyStroke> getFocusTraversalKeys_NoIDCheck(int id) {
// Okay to return Set directly because it is an unmodifiable view // Okay to return Set directly because it is an unmodifiable view
@SuppressWarnings("unchecked")
Set<AWTKeyStroke> keystrokes = (focusTraversalKeys != null) Set<AWTKeyStroke> keystrokes = (focusTraversalKeys != null)
? focusTraversalKeys[id] ? focusTraversalKeys[id]
: null; : null;
@ -8362,7 +8361,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
* @see #add(PopupMenu) * @see #add(PopupMenu)
* @since 1.1 * @since 1.1
*/ */
@SuppressWarnings("unchecked")
public void remove(MenuComponent popup) { public void remove(MenuComponent popup) {
synchronized (getTreeLock()) { synchronized (getTreeLock()) {
if (popups == null) { if (popups == null) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -814,7 +814,6 @@ public class Container extends Component {
* to new heavyweight parent. * to new heavyweight parent.
* @since 1.5 * @since 1.5
*/ */
@SuppressWarnings("deprecation")
private void reparentTraverse(ContainerPeer parentPeer, Container child) { private void reparentTraverse(ContainerPeer parentPeer, Container child) {
checkTreeLock(); checkTreeLock();
@ -838,7 +837,6 @@ public class Container extends Component {
* Container must be heavyweight. * Container must be heavyweight.
* @since 1.5 * @since 1.5
*/ */
@SuppressWarnings("deprecation")
private void reparentChild(Component comp) { private void reparentChild(Component comp) {
checkTreeLock(); checkTreeLock();
if (comp == null) { if (comp == null) {
@ -4203,7 +4201,6 @@ public class Container extends Component {
} }
} }
@SuppressWarnings("deprecation")
private void recursiveShowHeavyweightChildren() { private void recursiveShowHeavyweightChildren() {
if (!hasHeavyweightDescendants() || !isVisible()) { if (!hasHeavyweightDescendants() || !isVisible()) {
return; return;
@ -4225,7 +4222,6 @@ public class Container extends Component {
} }
} }
@SuppressWarnings("deprecation")
private void recursiveHideHeavyweightChildren() { private void recursiveHideHeavyweightChildren() {
if (!hasHeavyweightDescendants()) { if (!hasHeavyweightDescendants()) {
return; return;
@ -4247,7 +4243,6 @@ public class Container extends Component {
} }
} }
@SuppressWarnings("deprecation")
private void recursiveRelocateHeavyweightChildren(Point origin) { private void recursiveRelocateHeavyweightChildren(Point origin) {
for (int index = 0; index < getComponentCount(); index++) { for (int index = 0; index < getComponentCount(); index++) {
Component comp = getComponent(index); Component comp = getComponent(index);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1087,7 +1087,6 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
} }
} }
@SuppressWarnings("deprecation")
private boolean preDispatchKeyEvent(KeyEvent ke) { private boolean preDispatchKeyEvent(KeyEvent ke) {
if (((AWTEvent) ke).isPosted) { if (((AWTEvent) ke).isPosted) {
Component focusOwner = getFocusOwner(); Component focusOwner = getFocusOwner();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1058,7 +1058,7 @@ public class EventQueue {
} }
} }
@SuppressWarnings({"deprecation", "removal"}) @SuppressWarnings("removal")
final void initDispatchThread() { final void initDispatchThread() {
pushPopLock.lock(); pushPopLock.lock();
try { try {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -927,7 +927,6 @@ abstract class MediaEntry {
* The entry of the list of {@code Images} that is being tracked by the * The entry of the list of {@code Images} that is being tracked by the
* {@code MediaTracker}. * {@code MediaTracker}.
*/ */
@SuppressWarnings("serial") // MediaEntry does not have a no-arg ctor
class ImageMediaEntry extends MediaEntry implements ImageObserver, class ImageMediaEntry extends MediaEntry implements ImageObserver,
java.io.Serializable { java.io.Serializable {
@SuppressWarnings("serial") // Not statically typed as Serializable @SuppressWarnings("serial") // Not statically typed as Serializable

View File

@ -43,7 +43,6 @@ import sun.awt.SunToolkit;
* *
* @author David Mendenhall * @author David Mendenhall
*/ */
@SuppressWarnings("removal")
class SequencedEvent extends AWTEvent implements ActiveEvent { class SequencedEvent extends AWTEvent implements ActiveEvent {
/** /**

View File

@ -121,7 +121,7 @@ public final class SplashScreen {
* @return the {@link SplashScreen} instance, or {@code null} if there is * @return the {@link SplashScreen} instance, or {@code null} if there is
* none or it has already been closed * none or it has already been closed
*/ */
@SuppressWarnings({"removal", "restricted"}) @SuppressWarnings("restricted")
public static SplashScreen getSplashScreen() { public static SplashScreen getSplashScreen() {
synchronized (SplashScreen.class) { synchronized (SplashScreen.class) {
if (GraphicsEnvironment.isHeadless()) { if (GraphicsEnvironment.isHeadless()) {

View File

@ -161,7 +161,6 @@ class WaitDispatchSupport implements SecondaryLoop {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@SuppressWarnings("removal")
@Override @Override
public boolean enter() { public boolean enter() {
if (log.isLoggable(PlatformLogger.Level.FINE)) { if (log.isLoggable(PlatformLogger.Level.FINE)) {

View File

@ -798,7 +798,6 @@ public class Window extends Container implements Accessible {
* @see Component#isDisplayable * @see Component#isDisplayable
* @see #setMinimumSize * @see #setMinimumSize
*/ */
@SuppressWarnings("deprecation")
public void pack() { public void pack() {
Container parent = this.parent; Container parent = this.parent;
if (parent != null && parent.peer == null) { if (parent != null && parent.peer == null) {
@ -3604,7 +3603,6 @@ public class Window extends Container implements Accessible {
* *
* @since 1.7 * @since 1.7
*/ */
@SuppressWarnings("deprecation")
public void setOpacity(float opacity) { public void setOpacity(float opacity) {
synchronized (getTreeLock()) { synchronized (getTreeLock()) {
if (opacity < 0.0f || opacity > 1.0f) { if (opacity < 0.0f || opacity > 1.0f) {

View File

@ -905,7 +905,6 @@ public class DragSource implements Serializable {
* @since 1.5 * @since 1.5
*/ */
public static int getDragThreshold() { public static int getDragThreshold() {
@SuppressWarnings("removal")
int ts = Integer.getInteger("awt.dnd.drag.threshold", 0); int ts = Integer.getInteger("awt.dnd.drag.threshold", 0);
if (ts > 0) { if (ts > 0) {
return ts; return ts;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -391,7 +391,6 @@ public class FocusEvent extends ComponentEvent {
* @since 9 * @since 9
*/ */
@Serial @Serial
@SuppressWarnings("serial")
Object readResolve() throws ObjectStreamException { Object readResolve() throws ObjectStreamException {
if (cause != null) { if (cause != null) {
return this; return this;

View File

@ -105,7 +105,7 @@ public class Beans {
* @deprecated this method will be removed when java.beans.beancontext is removed * @deprecated this method will be removed when java.beans.beancontext is removed
*/ */
@Deprecated(since = "23", forRemoval = true) @Deprecated(since = "23", forRemoval = true)
@SuppressWarnings({"deprecation", "removal"}) @SuppressWarnings("removal")
public static Object instantiate(ClassLoader cls, String beanName, public static Object instantiate(ClassLoader cls, String beanName,
BeanContext beanContext) BeanContext beanContext)
throws IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {

View File

@ -41,7 +41,6 @@ import java.awt.Component;
* @see java.beans.beancontext.BeanContextSupport * @see java.beans.beancontext.BeanContextSupport
*/ */
@SuppressWarnings("removal")
@Deprecated(since = "23", forRemoval = true) @Deprecated(since = "23", forRemoval = true)
public interface BeanContextChildComponentProxy { public interface BeanContextChildComponentProxy {

View File

@ -40,7 +40,6 @@ import java.awt.Container;
* @see java.beans.beancontext.BeanContextSupport * @see java.beans.beancontext.BeanContextSupport
*/ */
@SuppressWarnings("removal")
@Deprecated(since = "23", forRemoval = true) @Deprecated(since = "23", forRemoval = true)
public interface BeanContextContainerProxy { public interface BeanContextContainerProxy {

View File

@ -35,7 +35,6 @@ import java.beans.BeanInfo;
* services. * services.
*/ */
@SuppressWarnings("removal")
@Deprecated(since = "23", forRemoval = true) @Deprecated(since = "23", forRemoval = true)
public interface BeanContextServiceProviderBeanInfo extends BeanInfo { public interface BeanContextServiceProviderBeanInfo extends BeanInfo {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,6 @@ import java.util.Comparator;
* @author David Mendenhall * @author David Mendenhall
* @since 1.2 * @since 1.2
*/ */
@SuppressWarnings("serial") // Obsolete class
public class DefaultFocusManager extends FocusManager { public class DefaultFocusManager extends FocusManager {
final FocusTraversalPolicy gluePolicy = final FocusTraversalPolicy gluePolicy =

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -714,7 +714,6 @@ class ColorChooserDialog extends JDialog {
cancelButton.getAccessibleContext().setAccessibleDescription(cancelString); cancelButton.getAccessibleContext().setAccessibleDescription(cancelString);
// The following few lines are used to register esc to close the dialog // The following few lines are used to register esc to close the dialog
@SuppressWarnings("serial") // anonymous class
Action cancelKeyAction = new AbstractAction() { Action cancelKeyAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
((AbstractButton)e.getSource()).fireActionPerformed(e); ((AbstractButton)e.getSource()).fireActionPerformed(e);

View File

@ -2949,7 +2949,7 @@ public abstract class JComponent extends Container implements Serializable,
* *
* @since 1.3 * @since 1.3
*/ */
@SuppressWarnings({"deprecation", "removal"}) @SuppressWarnings("deprecation")
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
int condition, boolean pressed) { int condition, boolean pressed) {
InputMap map = getInputMap(condition, false); InputMap map = getInputMap(condition, false);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -735,7 +735,6 @@ public final class JLayer<V extends Component>
* *
* @return the AccessibleContext associated with this {@code JLayer}. * @return the AccessibleContext associated with this {@code JLayer}.
*/ */
@SuppressWarnings("serial") // anonymous class
public AccessibleContext getAccessibleContext() { public AccessibleContext getAccessibleContext() {
if (accessibleContext == null) { if (accessibleContext == null) {
accessibleContext = new AccessibleJComponent() { accessibleContext = new AccessibleJComponent() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -66,7 +66,6 @@ import sun.swing.SwingAccessor;
* @author David Mendenhall * @author David Mendenhall
* @since 1.2 * @since 1.2
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class KeyStroke extends AWTKeyStroke { public class KeyStroke extends AWTKeyStroke {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -127,7 +127,6 @@ import java.awt.Component;
* @author Philip Milne * @author Philip Milne
* @since 1.4 * @since 1.4
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public abstract class Spring { public abstract class Spring {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -184,7 +184,6 @@ import java.util.*;
* @author Joe Winchester * @author Joe Winchester
* @since 1.4 * @since 1.4
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class SpringLayout implements LayoutManager2 { public class SpringLayout implements LayoutManager2 {
private Map<Component, Constraints> componentConstraints = new HashMap<Component, Constraints>(); private Map<Component, Constraints> componentConstraints = new HashMap<Component, Constraints>();

View File

@ -597,7 +597,6 @@ public class Timer implements Serializable
return lock; return lock;
} }
@SuppressWarnings("removal")
@Serial @Serial
private void readObject(ObjectInputStream in) private void readObject(ObjectInputStream in)
throws ClassNotFoundException, IOException throws ClassNotFoundException, IOException

View File

@ -1261,7 +1261,6 @@ public class UIManager implements Serializable
} }
} }
@SuppressWarnings("removal")
private static Properties loadSwingProperties() private static Properties loadSwingProperties()
{ {
/* Don't bother checking for Swing properties if untrusted, as /* Don't bother checking for Swing properties if untrusted, as

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,6 @@ import javax.swing.JComponent;
* *
* @author Steve Wilson * @author Steve Wilson
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class ColorChooserComponentFactory { public class ColorChooserComponentFactory {
private ColorChooserComponentFactory() { } // can't instantiate private ColorChooserComponentFactory() { } // can't instantiate

View File

@ -934,7 +934,6 @@ class WindowsFileSystemView extends FileSystemView {
return super.createFileObject(path); return super.createFileObject(path);
} }
@SuppressWarnings("serial") // anonymous class
protected File createFileSystemRoot(File f) { protected File createFileSystemRoot(File f) {
// Problem: Removable drives on Windows return false on f.exists() // Problem: Removable drives on Windows return false on f.exists()
// Workaround: Override exists() to always return true. // Workaround: Override exists() to always return true.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -615,7 +615,6 @@ public class LayerUI<V extends Component>
* baseline * baseline
*/ */
public int getBaseline(JComponent c, int width, int height) { public int getBaseline(JComponent c, int width, int height) {
@SuppressWarnings("unchecked")
JLayer<?> l = (JLayer) c; JLayer<?> l = (JLayer) c;
if (l.getView() != null) { if (l.getView() != null) {
return l.getView().getBaseline(width, height); return l.getView().getBaseline(width, height);
@ -633,7 +632,6 @@ public class LayerUI<V extends Component>
* size changes * size changes
*/ */
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c) { public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c) {
@SuppressWarnings("unchecked")
JLayer<?> l = (JLayer) c; JLayer<?> l = (JLayer) c;
if (l.getView() != null) { if (l.getView() != null) {
return l.getView().getBaselineResizeBehavior(); return l.getView().getBaselineResizeBehavior();
@ -666,7 +664,6 @@ public class LayerUI<V extends Component>
* @return preferred size for the passed {@code JLayer} * @return preferred size for the passed {@code JLayer}
*/ */
public Dimension getPreferredSize(JComponent c) { public Dimension getPreferredSize(JComponent c) {
@SuppressWarnings("unchecked")
JLayer<?> l = (JLayer) c; JLayer<?> l = (JLayer) c;
Component view = l.getView(); Component view = l.getView();
if (view != null) { if (view != null) {
@ -684,7 +681,6 @@ public class LayerUI<V extends Component>
* @return minimal size for the passed {@code JLayer} * @return minimal size for the passed {@code JLayer}
*/ */
public Dimension getMinimumSize(JComponent c) { public Dimension getMinimumSize(JComponent c) {
@SuppressWarnings("unchecked")
JLayer<?> l = (JLayer) c; JLayer<?> l = (JLayer) c;
Component view = l.getView(); Component view = l.getView();
if (view != null) { if (view != null) {
@ -702,7 +698,6 @@ public class LayerUI<V extends Component>
* @return maximum size for the passed {@code JLayer} * @return maximum size for the passed {@code JLayer}
*/ */
public Dimension getMaximumSize(JComponent c) { public Dimension getMaximumSize(JComponent c) {
@SuppressWarnings("unchecked")
JLayer<?> l = (JLayer) c; JLayer<?> l = (JLayer) c;
Component view = l.getView(); Component view = l.getView();
if (view != null) { if (view != null) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -49,7 +49,6 @@ import java.io.Serializable;
* *
* @author Jeff Dinkins * @author Jeff Dinkins
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class BasicCheckBoxUI extends BasicRadioButtonUI { public class BasicCheckBoxUI extends BasicRadioButtonUI {
private static final Object BASIC_CHECK_BOX_UI_KEY = new Object(); private static final Object BASIC_CHECK_BOX_UI_KEY = new Object();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -173,7 +173,6 @@ public class BasicComboBoxEditor implements ComboBoxEditor,FocusListener {
* has been added to the <code>java.beans</code> package. * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}. * Please see {@link java.beans.XMLEncoder}.
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public static class UIResource extends BasicComboBoxEditor public static class UIResource extends BasicComboBoxEditor
implements javax.swing.plaf.UIResource { implements javax.swing.plaf.UIResource {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1792,12 +1792,9 @@ public class BasicComboBoxUI extends ComboBoxUI {
comboBox.revalidate(); comboBox.revalidate();
} }
} else { } else {
@SuppressWarnings("unchecked")
JComboBox<?> comboBox = (JComboBox)e.getSource(); JComboBox<?> comboBox = (JComboBox)e.getSource();
if ( propertyName == "model" ) { if ( propertyName == "model" ) {
@SuppressWarnings("unchecked")
ComboBoxModel<?> newModel = (ComboBoxModel)e.getNewValue(); ComboBoxModel<?> newModel = (ComboBoxModel)e.getNewValue();
@SuppressWarnings("unchecked")
ComboBoxModel<?> oldModel = (ComboBoxModel)e.getOldValue(); ComboBoxModel<?> oldModel = (ComboBoxModel)e.getOldValue();
if ( oldModel != null && listDataListener != null ) { if ( oldModel != null && listDataListener != null ) {
@ -2012,7 +2009,6 @@ public class BasicComboBoxUI extends ComboBoxUI {
} }
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
@SuppressWarnings("unchecked")
JComboBox<?> cb = (JComboBox)parent; JComboBox<?> cb = (JComboBox)parent;
int width = cb.getWidth(); int width = cb.getWidth();
int height = cb.getHeight(); int height = cb.getHeight();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -696,7 +696,6 @@ public class BasicFileChooserUI extends FileChooserUI {
if(!evt.getValueIsAdjusting()) { if(!evt.getValueIsAdjusting()) {
JFileChooser chooser = getFileChooser(); JFileChooser chooser = getFileChooser();
FileSystemView fsv = chooser.getFileSystemView(); FileSystemView fsv = chooser.getFileSystemView();
@SuppressWarnings("unchecked")
JList<?> list = (JList)evt.getSource(); JList<?> list = (JList)evt.getSource();
int fsm = chooser.getFileSelectionMode(); int fsm = chooser.getFileSelectionMode();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1579,7 +1579,6 @@ public class BasicListUI extends ListUI
* @see #installKeyboardActions * @see #installKeyboardActions
* @see #installUI * @see #installUI
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MouseInputHandler implements MouseInputListener public class MouseInputHandler implements MouseInputListener
{ {
/** /**
@ -1703,7 +1702,6 @@ public class BasicListUI extends ListUI
* @see #getCellBounds * @see #getCellBounds
* @see #installUI * @see #installUI
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class ListSelectionHandler implements ListSelectionListener public class ListSelectionHandler implements ListSelectionListener
{ {
/** /**
@ -1769,7 +1767,6 @@ public class BasicListUI extends ListUI
* @see #createListDataListener * @see #createListDataListener
* @see #installUI * @see #installUI
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class ListDataHandler implements ListDataListener public class ListDataHandler implements ListDataListener
{ {
/** /**
@ -1842,7 +1839,6 @@ public class BasicListUI extends ListUI
* @see #createPropertyChangeListener * @see #createPropertyChangeListener
* @see #installUI * @see #installUI
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class PropertyChangeHandler implements PropertyChangeListener public class PropertyChangeHandler implements PropertyChangeListener
{ {
/** /**
@ -2653,9 +2649,7 @@ public class BasicListUI extends ListUI
* listDataListener from the old model and add it to the new one. * listDataListener from the old model and add it to the new one.
*/ */
if (propertyName == "model") { if (propertyName == "model") {
@SuppressWarnings("unchecked")
ListModel<?> oldModel = (ListModel)e.getOldValue(); ListModel<?> oldModel = (ListModel)e.getOldValue();
@SuppressWarnings("unchecked")
ListModel<?> newModel = (ListModel)e.getNewValue(); ListModel<?> newModel = (ListModel)e.getNewValue();
if (oldModel != null) { if (oldModel != null) {
oldModel.removeListDataListener(listDataListener); oldModel.removeListDataListener(listDataListener);

View File

@ -482,7 +482,6 @@ public class BasicOptionPaneUI extends OptionPaneUI {
if (nl >= 0) { if (nl >= 0) {
// break up newlines // break up newlines
if (nl == 0) { if (nl == 0) {
@SuppressWarnings("serial") // anonymous class
JPanel breakPanel = new JPanel() { JPanel breakPanel = new JPanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Font f = getFont(); Font f = getFont();

View File

@ -746,7 +746,6 @@ public class BasicSplitPaneDivider extends Container
* has been added to the <code>java.beans</code> package. * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}. * Please see {@link java.beans.XMLEncoder}.
*/ */
@SuppressWarnings("serial") // Same-version serialization only
protected class DragController protected class DragController
{ {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -899,7 +899,6 @@ public class BasicSplitPaneUI extends SplitPaneUI
* *
* @return the default non continuous layout divider * @return the default non continuous layout divider
*/ */
@SuppressWarnings("serial") // anonymous class
protected Component createDefaultNonContinuousLayoutDivider() { protected Component createDefaultNonContinuousLayoutDivider() {
return new Canvas() { return new Canvas() {
public void paint(Graphics g) { public void paint(Graphics g) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -49,7 +49,6 @@ import javax.swing.plaf.*;
* *
* @author Timothy Prinzing * @author Timothy Prinzing
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class BasicTextAreaUI extends BasicTextUI { public class BasicTextAreaUI extends BasicTextUI {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,7 +51,6 @@ import sun.swing.DefaultLookup;
* *
* @author Timothy Prinzing * @author Timothy Prinzing
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class BasicTextFieldUI extends BasicTextUI { public class BasicTextFieldUI extends BasicTextUI {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,6 @@ import javax.swing.border.*;
* *
* @author Timothy Prinzing * @author Timothy Prinzing
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class BasicTextPaneUI extends BasicEditorPaneUI { public class BasicTextPaneUI extends BasicEditorPaneUI {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -554,13 +554,11 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
@Deprecated(since = "17", forRemoval = true) @Deprecated(since = "17", forRemoval = true)
protected JFrame createFloatingFrame(JToolBar toolbar) { protected JFrame createFloatingFrame(JToolBar toolbar) {
Window window = SwingUtilities.getWindowAncestor(toolbar); Window window = SwingUtilities.getWindowAncestor(toolbar);
@SuppressWarnings("serial") // anonymous class
JFrame frame = new JFrame(toolbar.getName(), JFrame frame = new JFrame(toolbar.getName(),
(window != null) ? window.getGraphicsConfiguration() : null) { (window != null) ? window.getGraphicsConfiguration() : null) {
// Override createRootPane() to automatically resize // Override createRootPane() to automatically resize
// the frame when contents change // the frame when contents change
protected JRootPane createRootPane() { protected JRootPane createRootPane() {
@SuppressWarnings("serial") // anonymous class
JRootPane rootPane = new JRootPane() { JRootPane rootPane = new JRootPane() {
private boolean packing = false; private boolean packing = false;
@ -606,7 +604,6 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
// Override createRootPane() to automatically resize // Override createRootPane() to automatically resize
// the frame when contents change // the frame when contents change
protected JRootPane createRootPane() { protected JRootPane createRootPane() {
@SuppressWarnings("serial") // anonymous class
JRootPane rootPane = new JRootPane() { JRootPane rootPane = new JRootPane() {
private boolean packing = false; private boolean packing = false;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -46,7 +46,6 @@ import javax.swing.JList;
* *
* @author Tom Santos * @author Tom Santos
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public interface ComboPopup { public interface ComboPopup {
/** /**
* Shows the popup * Shows the popup

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -87,7 +87,6 @@ import sun.swing.SwingUtilities2;
* *
* @author Steve Wilson * @author Steve Wilson
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class DefaultMetalTheme extends MetalTheme { public class DefaultMetalTheme extends MetalTheme {
/** /**
* Whether or not fonts should be plain. This is only used if * Whether or not fonts should be plain. This is only used if

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,6 @@ import javax.swing.plaf.*;
* *
* @author Tom Santos * @author Tom Santos
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalButtonUI extends BasicButtonUI { public class MetalButtonUI extends BasicButtonUI {
// NOTE: These are not really needed, but at this point we can't pull // NOTE: These are not really needed, but at this point we can't pull

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,7 +51,6 @@ import java.io.Serializable;
* @author Michael C. Albers * @author Michael C. Albers
* *
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalCheckBoxUI extends MetalRadioButtonUI { public class MetalCheckBoxUI extends MetalRadioButtonUI {
// NOTE: MetalCheckBoxUI inherits from MetalRadioButtonUI instead // NOTE: MetalCheckBoxUI inherits from MetalRadioButtonUI instead

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -135,7 +135,6 @@ public class MetalComboBoxEditor extends BasicComboBoxEditor {
* has been added to the <code>java.beans</code> package. * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}. * Please see {@link java.beans.XMLEncoder}.
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public static class UIResource extends MetalComboBoxEditor public static class UIResource extends MetalComboBoxEditor
implements javax.swing.plaf.UIResource { implements javax.swing.plaf.UIResource {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -238,7 +238,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
topPanel.add(lookInLabel, BorderLayout.BEFORE_LINE_BEGINS); topPanel.add(lookInLabel, BorderLayout.BEFORE_LINE_BEGINS);
// CurrentDir ComboBox // CurrentDir ComboBox
@SuppressWarnings("serial") // anonymous class
JComboBox<Object> tmp1 = new JComboBox<Object>() { JComboBox<Object> tmp1 = new JComboBox<Object>() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension d = super.getPreferredSize(); Dimension d = super.getPreferredSize();
@ -381,7 +380,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
populateFileNameLabel(); populateFileNameLabel();
fileNamePanel.add(fileNameLabel); fileNamePanel.add(fileNameLabel);
@SuppressWarnings("serial") // anonymous class
JTextField tmp2 = new JTextField(35) { JTextField tmp2 = new JTextField(35) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
return new Dimension(Short.MAX_VALUE, super.getPreferredSize().height); return new Dimension(Short.MAX_VALUE, super.getPreferredSize().height);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,6 @@ import java.awt.*;
* *
* @author Michael C. Albers * @author Michael C. Albers
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalProgressBarUI extends BasicProgressBarUI { public class MetalProgressBarUI extends BasicProgressBarUI {
private Rectangle innards; private Rectangle innards;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -53,7 +53,6 @@ import javax.swing.text.View;
* @author Michael C. Albers (Metal modifications) * @author Michael C. Albers (Metal modifications)
* @author Jeff Dinkins (original BasicRadioButtonCode) * @author Jeff Dinkins (original BasicRadioButtonCode)
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalRadioButtonUI extends BasicRadioButtonUI { public class MetalRadioButtonUI extends BasicRadioButtonUI {
private static final Object METAL_RADIO_BUTTON_UI_KEY = new Object(); private static final Object METAL_RADIO_BUTTON_UI_KEY = new Object();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -77,7 +77,6 @@ import javax.swing.plaf.basic.BasicRootPaneUI;
* @author Terry Kellerman * @author Terry Kellerman
* @since 1.4 * @since 1.4
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalRootPaneUI extends BasicRootPaneUI public class MetalRootPaneUI extends BasicRootPaneUI
{ {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,6 @@ import java.awt.event.*;
* *
* @author Steve Wilson * @author Steve Wilson
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalScrollPaneUI extends BasicScrollPaneUI public class MetalScrollPaneUI extends BasicScrollPaneUI
{ {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,6 @@ import javax.swing.plaf.basic.BasicSeparatorUI;
* *
* @author Jeff Shapiro * @author Jeff Shapiro
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalSeparatorUI extends BasicSeparatorUI public class MetalSeparatorUI extends BasicSeparatorUI
{ {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,6 @@ import javax.swing.plaf.*;
* *
* @author Tom Santos * @author Tom Santos
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalSliderUI extends BasicSliderUI { public class MetalSliderUI extends BasicSliderUI {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,6 @@ import javax.swing.plaf.basic.*;
* *
* @author Steve Wilson * @author Steve Wilson
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalSplitPaneUI extends BasicSplitPaneUI public class MetalSplitPaneUI extends BasicSplitPaneUI
{ {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,6 @@ import javax.swing.plaf.basic.BasicTabbedPaneUI;
* *
* @author Tom Santos * @author Tom Santos
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalTabbedPaneUI extends BasicTabbedPaneUI { public class MetalTabbedPaneUI extends BasicTabbedPaneUI {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,6 @@ import javax.swing.plaf.basic.*;
* *
* @author Steve Wilson * @author Steve Wilson
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalTextFieldUI extends BasicTextFieldUI { public class MetalTextFieldUI extends BasicTextFieldUI {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -55,7 +55,6 @@ import java.io.Serializable;
* *
* @author Tom Santos * @author Tom Santos
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalToggleButtonUI extends BasicToggleButtonUI { public class MetalToggleButtonUI extends BasicToggleButtonUI {
private static final Object METAL_TOGGLE_BUTTON_UI_KEY = new Object(); private static final Object METAL_TOGGLE_BUTTON_UI_KEY = new Object();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -49,7 +49,6 @@ import javax.swing.text.View;
* *
* @author Steve Wilson * @author Steve Wilson
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MetalToolTipUI extends BasicToolTipUI { public class MetalToolTipUI extends BasicToolTipUI {
static MetalToolTipUI sharedInstance = new MetalToolTipUI(); static MetalToolTipUI sharedInstance = new MetalToolTipUI();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -210,7 +210,6 @@ class MetalUtils {
*/ */
static boolean drawGradient(Component c, Graphics g, String key, static boolean drawGradient(Component c, Graphics g, String key,
int x, int y, int w, int h, boolean vertical) { int x, int y, int w, int h, boolean vertical) {
@SuppressWarnings("unchecked")
java.util.List<?> gradient = (java.util.List)UIManager.get(key); java.util.List<?> gradient = (java.util.List)UIManager.get(key);
if (gradient == null || !(g instanceof Graphics2D)) { if (gradient == null || !(g instanceof Graphics2D)) {
return false; return false;
@ -275,7 +274,6 @@ class MetalUtils {
protected void paintToImage(Component c, Image image, Graphics g, protected void paintToImage(Component c, Image image, Graphics g,
int w, int h, Object[] args) { int w, int h, Object[] args) {
Graphics2D g2 = (Graphics2D)g; Graphics2D g2 = (Graphics2D)g;
@SuppressWarnings("unchecked")
java.util.List<?> gradient = (java.util.List)args[0]; java.util.List<?> gradient = (java.util.List)args[0];
boolean isVertical = ((Boolean)args[1]).booleanValue(); boolean isVertical = ((Boolean)args[1]).booleanValue();
// Render to the VolatileImage // Render to the VolatileImage

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -56,7 +56,6 @@ import javax.swing.plaf.*;
* *
* @author Willie Walker * @author Willie Walker
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class MultiLookAndFeel extends LookAndFeel { public class MultiLookAndFeel extends LookAndFeel {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -76,7 +76,6 @@ public class SynthDesktopIconUI extends BasicDesktopIconUI
@Override @Override
protected void installComponents() { protected void installComponents() {
if (UIManager.getBoolean("InternalFrame.useTaskBar")) { if (UIManager.getBoolean("InternalFrame.useTaskBar")) {
@SuppressWarnings("serial") // anonymous class
JToggleButton tmp = new JToggleButton(frame.getTitle(), frame.getFrameIcon()) { JToggleButton tmp = new JToggleButton(frame.getTitle(), frame.getFrameIcon()) {
@Override public String getToolTipText() { @Override public String getToolTipText() {
return getText(); return getText();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -376,7 +376,6 @@ public class SynthScrollBarUI extends BasicScrollBarUI
*/ */
@Override @Override
protected JButton createDecreaseButton(int orientation) { protected JButton createDecreaseButton(int orientation) {
@SuppressWarnings("serial") // anonymous class
SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) { SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) {
@Override @Override
public boolean contains(int x, int y) { public boolean contains(int x, int y) {
@ -406,7 +405,6 @@ public class SynthScrollBarUI extends BasicScrollBarUI
*/ */
@Override @Override
protected JButton createIncreaseButton(int orientation) { protected JButton createIncreaseButton(int orientation) {
@SuppressWarnings("serial") // anonymous class
SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) { SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) {
@Override @Override
public boolean contains(int x, int y) { public boolean contains(int x, int y) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -277,7 +277,6 @@ public class SynthSplitPaneUI extends BasicSplitPaneUI
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
@SuppressWarnings("serial") // anonymous class
protected Component createDefaultNonContinuousLayoutDivider() { protected Component createDefaultNonContinuousLayoutDivider() {
return new Canvas() { return new Canvas() {
public void paint(Graphics g) { public void paint(Graphics g) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,7 +51,6 @@ import java.beans.PropertyChangeEvent;
* @author Shannon Hickey * @author Shannon Hickey
* @since 1.7 * @since 1.7
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI { public class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI {
private Handler handler = new Handler(); private Handler handler = new Handler();
private SynthStyle style; private SynthStyle style;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,6 @@ import java.beans.PropertyChangeEvent;
* @author Shannon Hickey * @author Shannon Hickey
* @since 1.7 * @since 1.7
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class SynthTextFieldUI extends BasicTextFieldUI implements SynthUI { public class SynthTextFieldUI extends BasicTextFieldUI implements SynthUI {
private Handler handler = new Handler(); private Handler handler = new Handler();
private SynthStyle style; private SynthStyle style;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,6 @@ import java.awt.*;
* @author Shannon Hickey * @author Shannon Hickey
* @since 1.7 * @since 1.7
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class SynthTextPaneUI extends SynthEditorPaneUI { public class SynthTextPaneUI extends SynthEditorPaneUI {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -771,7 +771,6 @@ public class SynthTreeUI extends BasicTreeUI
@Override @Override
protected TreeCellEditor createTreeCellEditor() { protected TreeCellEditor createTreeCellEditor() {
@SuppressWarnings("serial") // anonymous class
JTextField tf = new JTextField() { JTextField tf = new JTextField() {
@Override @Override
public String getName() { public String getName() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1182,7 +1182,6 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc
* has been added to the <code>java.beans</code> package. * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}. * Please see {@link java.beans.XMLEncoder}.
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public static class ElementSpec { public static class ElementSpec {
/** /**

View File

@ -1127,7 +1127,6 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
* has been added to the <code>java.beans</code> package. * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}. * Please see {@link java.beans.XMLEncoder}.
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public static class KeyBinding { public static class KeyBinding {
/** /**
@ -3951,7 +3950,6 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
* Maps from class name to Boolean indicating if * Maps from class name to Boolean indicating if
* <code>processInputMethodEvent</code> has been overridden. * <code>processInputMethodEvent</code> has been overridden.
*/ */
@SuppressWarnings("removal")
private static Cache<Class<?>,Boolean> METHOD_OVERRIDDEN private static Cache<Class<?>,Boolean> METHOD_OVERRIDDEN
= new Cache<Class<?>,Boolean>(Cache.Kind.WEAK, Cache.Kind.STRONG) { = new Cache<Class<?>,Boolean>(Cache.Kind.WEAK, Cache.Kind.STRONG) {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -48,7 +48,6 @@ import java.util.LinkedHashMap;
* *
* @author Tim Prinzing * @author Tim Prinzing
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public class SimpleAttributeSet implements MutableAttributeSet, Serializable, Cloneable public class SimpleAttributeSet implements MutableAttributeSet, Serializable, Cloneable
{ {
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -171,7 +171,6 @@ public class StyledEditorKit extends DefaultEditorKit {
/** /**
* Creates the AttributeSet used for the selection. * Creates the AttributeSet used for the selection.
*/ */
@SuppressWarnings("serial") // anonymous class
private void createInputAttributes() { private void createInputAttributes() {
inputAttributes = new SimpleAttributeSet() { inputAttributes = new SimpleAttributeSet() {
public AttributeSet getResolveParent() { public AttributeSet getResolveParent() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -352,7 +352,6 @@ public class WrappedPlainView extends BoxView implements TabExpander {
* @param p1 the ending document location to use * @param p1 the ending document location to use
* @return the break position * @return the break position
*/ */
@SuppressWarnings("deprecation")
protected int calculateBreakPosition(int p0, int p1) { protected int calculateBreakPosition(int p0, int p1) {
int p; int p;
Segment segment = SegmentCache.getSharedSegment(); Segment segment = SegmentCache.getSharedSegment();
@ -798,7 +797,6 @@ public class WrappedPlainView extends BoxView implements TabExpander {
* given point in the view * given point in the view
* @see View#viewToModel * @see View#viewToModel
*/ */
@SuppressWarnings("deprecation")
public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) { public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) {
// PENDING(prinz) implement bias properly // PENDING(prinz) implement bias properly
bias[0] = Position.Bias.Forward; bias[0] = Position.Bias.Forward;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -382,7 +382,6 @@ public class FormView extends ComponentView implements ActionListener {
// BasicListUI$Handler. // BasicListUI$Handler.
// For JComboBox, there are 2 stale ListDataListeners, which are // For JComboBox, there are 2 stale ListDataListeners, which are
// BasicListUI$Handler and BasicComboBoxUI$Handler. // BasicListUI$Handler and BasicComboBoxUI$Handler.
@SuppressWarnings("unchecked")
AbstractListModel<?> listModel = (AbstractListModel) model; AbstractListModel<?> listModel = (AbstractListModel) model;
String listenerClass1 = String listenerClass1 =
"javax.swing.plaf.basic.BasicListUI$Handler"; "javax.swing.plaf.basic.BasicListUI$Handler";
@ -850,7 +849,6 @@ public class FormView extends ComponentView implements ActionListener {
} }
} }
} else if (m instanceof ComboBoxModel) { } else if (m instanceof ComboBoxModel) {
@SuppressWarnings("unchecked")
ComboBoxModel<?> model = (ComboBoxModel)m; ComboBoxModel<?> model = (ComboBoxModel)m;
Option option = (Option)model.getSelectedItem(); Option option = (Option)model.getSelectedItem();
if (option != null) { if (option != null) {
@ -962,7 +960,6 @@ public class FormView extends ComponentView implements ActionListener {
} catch (BadLocationException e) { } catch (BadLocationException e) {
} }
} else if (m instanceof OptionListModel) { } else if (m instanceof OptionListModel) {
@SuppressWarnings("unchecked")
OptionListModel<?> model = (OptionListModel) m; OptionListModel<?> model = (OptionListModel) m;
int size = model.getSize(); int size = model.getSize();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
@ -975,7 +972,6 @@ public class FormView extends ComponentView implements ActionListener {
} }
} }
} else if (m instanceof OptionComboBoxModel) { } else if (m instanceof OptionComboBoxModel) {
@SuppressWarnings("unchecked")
OptionComboBoxModel<?> model = (OptionComboBoxModel) m; OptionComboBoxModel<?> model = (OptionComboBoxModel) m;
Option option = model.getInitialSelection(); Option option = model.getInitialSelection();
if (option != null) { if (option != null) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -41,7 +41,6 @@ import java.util.Enumeration;
* *
* @author Scott Violet * @author Scott Violet
*/ */
@SuppressWarnings("serial") // Same-version serialization only
public abstract class AbstractLayoutCache implements RowMapper { public abstract class AbstractLayoutCache implements RowMapper {
/** Object responsible for getting the size of a node. */ /** Object responsible for getting the size of a node. */
protected NodeDimensions nodeDimensions; protected NodeDimensions nodeDimensions;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -537,7 +537,6 @@ public class DefaultTreeCellEditor implements ActionListener, TreeCellEditor,
*/ */
protected TreeCellEditor createTreeCellEditor() { protected TreeCellEditor createTreeCellEditor() {
Border aBorder = UIManager.getBorder("Tree.editorBorder"); Border aBorder = UIManager.getBorder("Tree.editorBorder");
@SuppressWarnings("serial") // Safe: outer class is non-serializable
DefaultCellEditor editor = new DefaultCellEditor DefaultCellEditor editor = new DefaultCellEditor
(new DefaultTextField(aBorder)) { (new DefaultTextField(aBorder)) {
public boolean shouldSelectCell(EventObject event) { public boolean shouldSelectCell(EventObject event) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -321,7 +321,6 @@ public final class AWTAutoShutdown implements Runnable {
} }
} }
@SuppressWarnings("serial")
static AWTEvent getShutdownEvent() { static AWTEvent getShutdownEvent() {
return new AWTEvent(getInstance(), 0) { return new AWTEvent(getInstance(), 0) {
}; };

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -362,7 +362,6 @@ public final class AppContext {
* contained within this AppContext * contained within this AppContext
* @since 1.2 * @since 1.2
*/ */
@SuppressWarnings("deprecation")
public void dispose() throws IllegalThreadStateException { public void dispose() throws IllegalThreadStateException {
System.err.println( System.err.println(
""" """

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -59,7 +59,6 @@ class CausedFocusEvent extends FocusEvent {
RETARGETED RETARGETED
} }
@SuppressWarnings("serial")
private static final Component dummy = new Component(){}; private static final Component dummy = new Component(){};
private final Cause cause; private final Cause cause;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -104,7 +104,6 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
/* /*
* Posts proper lost/gain focus events to the event queue. * Posts proper lost/gain focus events to the event queue.
*/ */
@SuppressWarnings("deprecation")
public static boolean deliverFocus(Component lightweightChild, public static boolean deliverFocus(Component lightweightChild,
Component target, Component target,
boolean temporary, boolean temporary,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -88,7 +88,6 @@ public abstract class LightweightFrame extends Frame {
@Override public final void toFront() {} @Override public final void toFront() {}
@Override public final void toBack() {} @Override public final void toBack() {}
@SuppressWarnings("deprecation")
@Override public void addNotify() { @Override public void addNotify() {
synchronized (getTreeLock()) { synchronized (getTreeLock()) {
if (!isDisplayable()) { if (!isDisplayable()) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -525,7 +525,6 @@ public abstract class SunToolkit extends Toolkit
* Fixed 5064013: the InvocationEvent time should be equals * Fixed 5064013: the InvocationEvent time should be equals
* the time of the ActionEvent * the time of the ActionEvent
*/ */
@SuppressWarnings("serial")
public static void executeOnEventHandlerThread(Object target, public static void executeOnEventHandlerThread(Object target,
Runnable runnable, Runnable runnable,
final long when) { final long when) {
@ -1569,7 +1568,6 @@ public abstract class SunToolkit extends Toolkit
* Should return {@code true} if more processing is * Should return {@code true} if more processing is
* necessary, {@code false} otherwise. * necessary, {@code false} otherwise.
*/ */
@SuppressWarnings("serial")
private final boolean waitForIdle(final long end) { private final boolean waitForIdle(final long end) {
if (timeout(end) <= 0) { if (timeout(end) <= 0) {
return false; return false;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -241,7 +241,6 @@ public class Disposer implements Runnable {
* so will clutter the records hashmap and no one will be cleaning up * so will clutter the records hashmap and no one will be cleaning up
* the reference queue. * the reference queue.
*/ */
@SuppressWarnings("unchecked")
public static void addReference(Reference<Object> ref, DisposerRecord rec) { public static void addReference(Reference<Object> ref, DisposerRecord rec) {
records.put(ref, rec); records.put(ref, rec);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1300,7 +1300,6 @@ public final class DMarlinRenderingEngine extends RenderingEngine
* Get the RendererContext instance dedicated to the current thread * Get the RendererContext instance dedicated to the current thread
* @return RendererContext instance * @return RendererContext instance
*/ */
@SuppressWarnings({"unchecked"})
static RendererContext getRendererContext() { static RendererContext getRendererContext() {
final RendererContext rdrCtx = RDR_CTX_PROVIDER.acquire(); final RendererContext rdrCtx = RDR_CTX_PROVIDER.acquire();
if (DO_MONITORS) { if (DO_MONITORS) {

Some files were not shown because too many files have changed in this diff Show More