diff --git a/src/demo/share/jfc/SampleTree/SampleTree.java b/src/demo/share/jfc/SampleTree/SampleTree.java index 90588e6ec3a..8ff33828791 100644 --- a/src/demo/share/jfc/SampleTree/SampleTree.java +++ b/src/demo/share/jfc/SampleTree/SampleTree.java @@ -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 * 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 * options that tree supports. */ - @SuppressWarnings("serial") private JPanel constructOptionsPanel() { JCheckBox aCheckbox; JPanel retPanel = new JPanel(false); diff --git a/src/demo/share/jfc/TableExample/TableExample3.java b/src/demo/share/jfc/TableExample/TableExample3.java index 9f3c11f4448..a5344f8802a 100644 --- a/src/demo/share/jfc/TableExample/TableExample3.java +++ b/src/demo/share/jfc/TableExample/TableExample3.java @@ -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 * modification, are permitted provided that the following conditions @@ -97,7 +97,6 @@ public class TableExample3 { }; // Create a model of the data. - @SuppressWarnings("serial") TableModel dataModel = new AbstractTableModel() { // These methods always need to be implemented. diff --git a/src/demo/share/jfc/TableExample/TableExample4.java b/src/demo/share/jfc/TableExample/TableExample4.java index 4d81a3d8cf3..b429c9ec9de 100644 --- a/src/demo/share/jfc/TableExample/TableExample4.java +++ b/src/demo/share/jfc/TableExample/TableExample4.java @@ -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 * modification, are permitted provided that the following conditions @@ -99,7 +99,6 @@ public class TableExample4 { }; // Create a model of the data. - @SuppressWarnings("serial") TableModel dataModel = new AbstractTableModel() { // 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. TableColumn numbersColumn = tableView.getColumn("Favorite Number"); - @SuppressWarnings("serial") DefaultTableCellRenderer numberColumnRenderer = new DefaultTableCellRenderer() { diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java index b79cc98be9d..a9eab801b0d 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,6 @@ class AquaComboBoxButton extends JButton { boolean isPopDown; boolean isSquare; - @SuppressWarnings("serial") // anonymous class protected AquaComboBoxButton(final AquaComboBoxUI ui, final JComboBox comboBox, final CellRendererPane rendererPane, diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java index 981a00d5588..dc29d0b5ae8 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -161,7 +161,6 @@ final class AquaComboBoxPopup extends BasicComboPopup { } @Override - @SuppressWarnings("serial") // anonymous class protected JList createList() { return new JList(comboBox.getModel()) { @Override diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java index b9b60994085..130c30aa9e1 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java @@ -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. * * 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 class AquaCustomComboTextField extends JTextField { - @SuppressWarnings("serial") // anonymous class public AquaCustomComboTextField() { final InputMap inputMap = getInputMap(); 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. */ - @SuppressWarnings("serial") // anonymous class private Action highlightNextAction = new ComboBoxAction() { @Override 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. */ - @SuppressWarnings("serial") // anonymous class private Action highlightPreviousAction = new ComboBoxAction() { @Override 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() { @Override 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() { @Override 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() { @Override 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() { @Override 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 // arrow up or down does not automatically select the - @SuppressWarnings("serial") // anonymous class private final Action triggerSelectionAction = new AbstractAction() { public void actionPerformed(final ActionEvent 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() { public void actionPerformed(final ActionEvent e) { 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() { @Override 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() { @Override 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() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java index e4b112cc297..bdb440bf4d2 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java @@ -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. * * 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); } - @SuppressWarnings("serial") // anonymous class protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) { return new AquaComboBoxRendererInternal(directoryComboBox) { public Component getListCellRendererComponent(final JList list, @@ -1356,7 +1355,6 @@ public class AquaFileChooserUI extends FileChooserUI { // // Renderer for Types ComboBox // - @SuppressWarnings("serial") // anonymous class protected ListCellRenderer createFilterComboBoxRenderer() { return new AquaComboBoxRendererInternal(filterComboBox) { public Component getListCellRendererComponent(final JList list, @@ -1611,7 +1609,6 @@ public class AquaFileChooserUI extends FileChooserUI { tPanel.add(labelArea); // separator line - @SuppressWarnings("serial") // anonymous class final JSeparator sep = new JSeparator(){ public Dimension getPreferredSize() { return new Dimension(((JComponent)getParent()).getWidth(), 3); diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java index 32b43dba295..653cf49cb55 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java @@ -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. * * 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; -@SuppressWarnings("serial") // JDK implementation class class AquaFileView extends FileView { private static final boolean DEBUG = false; diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java index e00722bc293..1a10e30a6c6 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java @@ -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. * * 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) { menuItem = new JMenuItem(tabPane.getTitleAt(i), tabPane.getIconAt(i)); } else { - @SuppressWarnings("serial") // anonymous class JMenuItem tmp = new JMenuItem() { public void paintComponent(final Graphics g) { super.paintComponent(g); diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldSearch.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldSearch.java index 99349b6c6b3..a6be82d9ac3 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldSearch.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldSearch.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -249,7 +249,6 @@ public class AquaTextFieldSearch { label.setText(promptText); } - @SuppressWarnings("serial") // anonymous class inside protected static JButton getCancelButton(final JTextComponent c) { final JButton b = createButton(c, getCancelIcon()); b.setName("cancel"); @@ -326,7 +325,6 @@ public class AquaTextFieldSearch { } protected boolean doingLayout; - @SuppressWarnings("serial") // anonymous class inside protected LayoutManager getCustomLayout() { // 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 diff --git a/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java b/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java index a9081ae3c36..905a66b3212 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -254,7 +254,6 @@ final class LWListPeer extends LWComponentPeer } @Override - @SuppressWarnings("unchecked") public void valueChanged(final ListSelectionEvent e) { if (!e.getValueIsAdjusting() && !isSkipStateChangedEvent()) { final JList source = (JList) e.getSource(); diff --git a/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java b/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java index 4ec8d87fee3..13b6372a3c8 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -1353,7 +1353,6 @@ public class LWWindowPeer changeFocusedWindow(activate, null); } - @SuppressWarnings("deprecation") private boolean isOneOfOwnersOf(LWWindowPeer peer) { Window owner = (peer != null ? peer.getTarget().getOwner() : null); while (owner != null) { diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 3af1b4bcdda..0596ad2379e 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -268,7 +268,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } } }) { - @SuppressWarnings("deprecation") public CPlatformWindow convertJComponentToTarget(final JRootPane p) { Component root = SwingUtilities.getRoot(p); final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java index 5ad3db345e2..bc787f9127c 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java @@ -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. * * 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); } - @SuppressWarnings("removal") protected void finalize() throws Throwable { super.finalize(); JPEGReader.dispose(); diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java index a6d2f5bbb0e..0f1ecd0dc1e 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java @@ -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. * * 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.setAlignmentX(JComponent.CENTER_ALIGNMENT); - @SuppressWarnings("serial") // anonymous class JPanel interior = new JPanel() { public Insets getInsets() { return insets; @@ -305,7 +304,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI { curDirName = currentDirectory.getPath(); } - @SuppressWarnings("serial") // anonymous class JTextField tmp1 = new JTextField(curDirName, 35) { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); @@ -341,7 +339,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI { align(l); leftPanel.add(l); - @SuppressWarnings("serial") // anonymous class JComboBox tmp2 = new JComboBox() { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); @@ -419,7 +416,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI { align(fileNameLabel); interior.add(fileNameLabel); - @SuppressWarnings("serial") // anonymous class JTextField tmp3 = new JTextField(35) { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); @@ -444,7 +440,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI { buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS)); buttonPanel.add(Box.createGlue()); - @SuppressWarnings("serial") // anonymous class JButton tmp4 = new JButton(getApproveButtonText(fc)) { public Dimension getMaximumSize() { return new Dimension(MAX_SIZE.width, this.getPreferredSize().height); @@ -460,7 +455,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI { buttonPanel.add(approveButton); buttonPanel.add(Box.createGlue()); - @SuppressWarnings("serial") // anonymous class JButton updateButton = new JButton(updateButtonText) { public Dimension getMaximumSize() { return new Dimension(MAX_SIZE.width, this.getPreferredSize().height); @@ -475,7 +469,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI { buttonPanel.add(updateButton); buttonPanel.add(Box.createGlue()); - @SuppressWarnings("serial") // anonymous class JButton cancelButton = new JButton(cancelButtonText) { public Dimension getMaximumSize() { return new Dimension(MAX_SIZE.width, this.getPreferredSize().height); @@ -490,7 +483,6 @@ public class MotifFileChooserUI extends BasicFileChooserUI { buttonPanel.add(cancelButton); buttonPanel.add(Box.createGlue()); - @SuppressWarnings("serial") // anonymous class JButton helpButton = new JButton(helpButtonText) { public Dimension getMaximumSize() { return new Dimension(MAX_SIZE.width, this.getPreferredSize().height); diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java index cba71847fa4..1179df181ab 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java @@ -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. * * 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(){ super.setupMenuOpenKey(); ActionMap map = SwingUtilities.getUIActionMap(frame); @@ -152,7 +151,6 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI { } } - @SuppressWarnings("serial") // anonymous class protected void setupMenuCloseKey(){ ActionMap map = SwingUtilities.getUIActionMap(frame); if (map != null) { diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java index a9c40aa71af..e68d7e2d8bf 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -72,7 +72,6 @@ public class MotifOptionPaneUI extends BasicOptionPaneUI return null; } - @SuppressWarnings("serial") // anonymous class protected Container createSeparator() { return new JPanel() { diff --git a/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java b/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java index affec1aace1..00862ea9022 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java @@ -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. * * 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 Florian Bomers */ -@SuppressWarnings({"deprecation", "removal"}) +@SuppressWarnings("removal") public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener { private long lastPlayCall = 0; diff --git a/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java b/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java index 56084ec8f90..592482823db 100644 --- a/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java +++ b/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java @@ -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. * * 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 * @since 1.4 */ - @SuppressWarnings("overloads") public static WindowStateListener add(WindowStateListener a, WindowStateListener b) { return (WindowStateListener)addInternal(a, b); @@ -828,7 +827,6 @@ public class AWTEventMulticaster implements * @return the resulting listener * @since 1.4 */ - @SuppressWarnings("overloads") public static WindowStateListener remove(WindowStateListener l, WindowStateListener oldl) { return (WindowStateListener) removeInternal(l, oldl); diff --git a/src/java.desktop/share/classes/java/awt/Component.java b/src/java.desktop/share/classes/java/awt/Component.java index a1f8461c802..71618eea95b 100644 --- a/src/java.desktop/share/classes/java/awt/Component.java +++ b/src/java.desktop/share/classes/java/awt/Component.java @@ -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. * * 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 getFocusTraversalKeys_NoIDCheck(int id) { // Okay to return Set directly because it is an unmodifiable view - @SuppressWarnings("unchecked") Set keystrokes = (focusTraversalKeys != null) ? focusTraversalKeys[id] : null; @@ -8362,7 +8361,6 @@ public abstract class Component implements ImageObserver, MenuContainer, * @see #add(PopupMenu) * @since 1.1 */ - @SuppressWarnings("unchecked") public void remove(MenuComponent popup) { synchronized (getTreeLock()) { if (popups == null) { diff --git a/src/java.desktop/share/classes/java/awt/Container.java b/src/java.desktop/share/classes/java/awt/Container.java index 2eb2c923de0..63bd7467d91 100644 --- a/src/java.desktop/share/classes/java/awt/Container.java +++ b/src/java.desktop/share/classes/java/awt/Container.java @@ -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. * * 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. * @since 1.5 */ - @SuppressWarnings("deprecation") private void reparentTraverse(ContainerPeer parentPeer, Container child) { checkTreeLock(); @@ -838,7 +837,6 @@ public class Container extends Component { * Container must be heavyweight. * @since 1.5 */ - @SuppressWarnings("deprecation") private void reparentChild(Component comp) { checkTreeLock(); if (comp == null) { @@ -4203,7 +4201,6 @@ public class Container extends Component { } } - @SuppressWarnings("deprecation") private void recursiveShowHeavyweightChildren() { if (!hasHeavyweightDescendants() || !isVisible()) { return; @@ -4225,7 +4222,6 @@ public class Container extends Component { } } - @SuppressWarnings("deprecation") private void recursiveHideHeavyweightChildren() { if (!hasHeavyweightDescendants()) { return; @@ -4247,7 +4243,6 @@ public class Container extends Component { } } - @SuppressWarnings("deprecation") private void recursiveRelocateHeavyweightChildren(Point origin) { for (int index = 0; index < getComponentCount(); index++) { Component comp = getComponent(index); diff --git a/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java b/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java index 3c57ec3a8d9..8ee336548d2 100644 --- a/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -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. * * 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) { if (((AWTEvent) ke).isPosted) { Component focusOwner = getFocusOwner(); diff --git a/src/java.desktop/share/classes/java/awt/EventQueue.java b/src/java.desktop/share/classes/java/awt/EventQueue.java index 57a9a6cf567..f79ff285a79 100644 --- a/src/java.desktop/share/classes/java/awt/EventQueue.java +++ b/src/java.desktop/share/classes/java/awt/EventQueue.java @@ -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. * * 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() { pushPopLock.lock(); try { diff --git a/src/java.desktop/share/classes/java/awt/MediaTracker.java b/src/java.desktop/share/classes/java/awt/MediaTracker.java index 2435dd0ba33..408d68ffe14 100644 --- a/src/java.desktop/share/classes/java/awt/MediaTracker.java +++ b/src/java.desktop/share/classes/java/awt/MediaTracker.java @@ -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. * * 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 * {@code MediaTracker}. */ -@SuppressWarnings("serial") // MediaEntry does not have a no-arg ctor class ImageMediaEntry extends MediaEntry implements ImageObserver, java.io.Serializable { @SuppressWarnings("serial") // Not statically typed as Serializable diff --git a/src/java.desktop/share/classes/java/awt/SequencedEvent.java b/src/java.desktop/share/classes/java/awt/SequencedEvent.java index a671814a57b..e04757e195f 100644 --- a/src/java.desktop/share/classes/java/awt/SequencedEvent.java +++ b/src/java.desktop/share/classes/java/awt/SequencedEvent.java @@ -43,7 +43,6 @@ import sun.awt.SunToolkit; * * @author David Mendenhall */ -@SuppressWarnings("removal") class SequencedEvent extends AWTEvent implements ActiveEvent { /** diff --git a/src/java.desktop/share/classes/java/awt/SplashScreen.java b/src/java.desktop/share/classes/java/awt/SplashScreen.java index 7f522026b8a..737c1a5c080 100644 --- a/src/java.desktop/share/classes/java/awt/SplashScreen.java +++ b/src/java.desktop/share/classes/java/awt/SplashScreen.java @@ -121,7 +121,7 @@ public final class SplashScreen { * @return the {@link SplashScreen} instance, or {@code null} if there is * none or it has already been closed */ - @SuppressWarnings({"removal", "restricted"}) + @SuppressWarnings("restricted") public static SplashScreen getSplashScreen() { synchronized (SplashScreen.class) { if (GraphicsEnvironment.isHeadless()) { diff --git a/src/java.desktop/share/classes/java/awt/WaitDispatchSupport.java b/src/java.desktop/share/classes/java/awt/WaitDispatchSupport.java index 2968c9ad3ef..50a66e997f9 100644 --- a/src/java.desktop/share/classes/java/awt/WaitDispatchSupport.java +++ b/src/java.desktop/share/classes/java/awt/WaitDispatchSupport.java @@ -161,7 +161,6 @@ class WaitDispatchSupport implements SecondaryLoop { /** * {@inheritDoc} */ - @SuppressWarnings("removal") @Override public boolean enter() { if (log.isLoggable(PlatformLogger.Level.FINE)) { diff --git a/src/java.desktop/share/classes/java/awt/Window.java b/src/java.desktop/share/classes/java/awt/Window.java index 1a5395431ab..9b855739443 100644 --- a/src/java.desktop/share/classes/java/awt/Window.java +++ b/src/java.desktop/share/classes/java/awt/Window.java @@ -798,7 +798,6 @@ public class Window extends Container implements Accessible { * @see Component#isDisplayable * @see #setMinimumSize */ - @SuppressWarnings("deprecation") public void pack() { Container parent = this.parent; if (parent != null && parent.peer == null) { @@ -3604,7 +3603,6 @@ public class Window extends Container implements Accessible { * * @since 1.7 */ - @SuppressWarnings("deprecation") public void setOpacity(float opacity) { synchronized (getTreeLock()) { if (opacity < 0.0f || opacity > 1.0f) { diff --git a/src/java.desktop/share/classes/java/awt/dnd/DragSource.java b/src/java.desktop/share/classes/java/awt/dnd/DragSource.java index 8477bc6376d..b5da544c46d 100644 --- a/src/java.desktop/share/classes/java/awt/dnd/DragSource.java +++ b/src/java.desktop/share/classes/java/awt/dnd/DragSource.java @@ -905,7 +905,6 @@ public class DragSource implements Serializable { * @since 1.5 */ public static int getDragThreshold() { - @SuppressWarnings("removal") int ts = Integer.getInteger("awt.dnd.drag.threshold", 0); if (ts > 0) { return ts; diff --git a/src/java.desktop/share/classes/java/awt/event/FocusEvent.java b/src/java.desktop/share/classes/java/awt/event/FocusEvent.java index 4fb9043e5b7..27da2e8b4bb 100644 --- a/src/java.desktop/share/classes/java/awt/event/FocusEvent.java +++ b/src/java.desktop/share/classes/java/awt/event/FocusEvent.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -391,7 +391,6 @@ public class FocusEvent extends ComponentEvent { * @since 9 */ @Serial - @SuppressWarnings("serial") Object readResolve() throws ObjectStreamException { if (cause != null) { return this; diff --git a/src/java.desktop/share/classes/java/beans/Beans.java b/src/java.desktop/share/classes/java/beans/Beans.java index 247f6982471..e35a751a42e 100644 --- a/src/java.desktop/share/classes/java/beans/Beans.java +++ b/src/java.desktop/share/classes/java/beans/Beans.java @@ -105,7 +105,7 @@ public class Beans { * @deprecated this method will be removed when java.beans.beancontext is removed */ @Deprecated(since = "23", forRemoval = true) - @SuppressWarnings({"deprecation", "removal"}) + @SuppressWarnings("removal") public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext) throws IOException, ClassNotFoundException { diff --git a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildComponentProxy.java b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildComponentProxy.java index 91d22ecce3b..9f79d1c27a9 100644 --- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildComponentProxy.java +++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildComponentProxy.java @@ -41,7 +41,6 @@ import java.awt.Component; * @see java.beans.beancontext.BeanContextSupport */ -@SuppressWarnings("removal") @Deprecated(since = "23", forRemoval = true) public interface BeanContextChildComponentProxy { diff --git a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextContainerProxy.java b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextContainerProxy.java index 3c6e0656c50..4fe6758b21f 100644 --- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextContainerProxy.java +++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextContainerProxy.java @@ -40,7 +40,6 @@ import java.awt.Container; * @see java.beans.beancontext.BeanContextSupport */ -@SuppressWarnings("removal") @Deprecated(since = "23", forRemoval = true) public interface BeanContextContainerProxy { diff --git a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java index 11fe3fff730..60c80edee35 100644 --- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java +++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java @@ -35,7 +35,6 @@ import java.beans.BeanInfo; * services. */ -@SuppressWarnings("removal") @Deprecated(since = "23", forRemoval = true) public interface BeanContextServiceProviderBeanInfo extends BeanInfo { diff --git a/src/java.desktop/share/classes/javax/swing/DefaultFocusManager.java b/src/java.desktop/share/classes/javax/swing/DefaultFocusManager.java index 4413721097d..47cca584452 100644 --- a/src/java.desktop/share/classes/javax/swing/DefaultFocusManager.java +++ b/src/java.desktop/share/classes/javax/swing/DefaultFocusManager.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,6 @@ import java.util.Comparator; * @author David Mendenhall * @since 1.2 */ -@SuppressWarnings("serial") // Obsolete class public class DefaultFocusManager extends FocusManager { final FocusTraversalPolicy gluePolicy = diff --git a/src/java.desktop/share/classes/javax/swing/JColorChooser.java b/src/java.desktop/share/classes/javax/swing/JColorChooser.java index 62c4fe8b083..89291be5f04 100644 --- a/src/java.desktop/share/classes/javax/swing/JColorChooser.java +++ b/src/java.desktop/share/classes/javax/swing/JColorChooser.java @@ -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. * * 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); // The following few lines are used to register esc to close the dialog - @SuppressWarnings("serial") // anonymous class Action cancelKeyAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { ((AbstractButton)e.getSource()).fireActionPerformed(e); diff --git a/src/java.desktop/share/classes/javax/swing/JComponent.java b/src/java.desktop/share/classes/javax/swing/JComponent.java index 352fefeaacb..92f3f01ab3e 100644 --- a/src/java.desktop/share/classes/javax/swing/JComponent.java +++ b/src/java.desktop/share/classes/javax/swing/JComponent.java @@ -2949,7 +2949,7 @@ public abstract class JComponent extends Container implements Serializable, * * @since 1.3 */ - @SuppressWarnings({"deprecation", "removal"}) + @SuppressWarnings("deprecation") protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { InputMap map = getInputMap(condition, false); diff --git a/src/java.desktop/share/classes/javax/swing/JLayer.java b/src/java.desktop/share/classes/javax/swing/JLayer.java index b08b140933f..7ce28b2b723 100644 --- a/src/java.desktop/share/classes/javax/swing/JLayer.java +++ b/src/java.desktop/share/classes/javax/swing/JLayer.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -735,7 +735,6 @@ public final class JLayer * * @return the AccessibleContext associated with this {@code JLayer}. */ - @SuppressWarnings("serial") // anonymous class public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJComponent() { diff --git a/src/java.desktop/share/classes/javax/swing/KeyStroke.java b/src/java.desktop/share/classes/javax/swing/KeyStroke.java index dcd87c74535..054d1ad72bb 100644 --- a/src/java.desktop/share/classes/javax/swing/KeyStroke.java +++ b/src/java.desktop/share/classes/javax/swing/KeyStroke.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,6 @@ import sun.swing.SwingAccessor; * @author David Mendenhall * @since 1.2 */ -@SuppressWarnings("serial") // Same-version serialization only public class KeyStroke extends AWTKeyStroke { /** diff --git a/src/java.desktop/share/classes/javax/swing/Spring.java b/src/java.desktop/share/classes/javax/swing/Spring.java index 751eef76435..cf4504f51f9 100644 --- a/src/java.desktop/share/classes/javax/swing/Spring.java +++ b/src/java.desktop/share/classes/javax/swing/Spring.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -127,7 +127,6 @@ import java.awt.Component; * @author Philip Milne * @since 1.4 */ -@SuppressWarnings("serial") // Same-version serialization only public abstract class Spring { /** diff --git a/src/java.desktop/share/classes/javax/swing/SpringLayout.java b/src/java.desktop/share/classes/javax/swing/SpringLayout.java index 27641690e22..76050d31ce3 100644 --- a/src/java.desktop/share/classes/javax/swing/SpringLayout.java +++ b/src/java.desktop/share/classes/javax/swing/SpringLayout.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -184,7 +184,6 @@ import java.util.*; * @author Joe Winchester * @since 1.4 */ -@SuppressWarnings("serial") // Same-version serialization only public class SpringLayout implements LayoutManager2 { private Map componentConstraints = new HashMap(); diff --git a/src/java.desktop/share/classes/javax/swing/Timer.java b/src/java.desktop/share/classes/javax/swing/Timer.java index 3801eb0a072..46051d92df1 100644 --- a/src/java.desktop/share/classes/javax/swing/Timer.java +++ b/src/java.desktop/share/classes/javax/swing/Timer.java @@ -597,7 +597,6 @@ public class Timer implements Serializable return lock; } - @SuppressWarnings("removal") @Serial private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException diff --git a/src/java.desktop/share/classes/javax/swing/UIManager.java b/src/java.desktop/share/classes/javax/swing/UIManager.java index 4c55e0c5149..752b37a5238 100644 --- a/src/java.desktop/share/classes/javax/swing/UIManager.java +++ b/src/java.desktop/share/classes/javax/swing/UIManager.java @@ -1261,7 +1261,6 @@ public class UIManager implements Serializable } } - @SuppressWarnings("removal") private static Properties loadSwingProperties() { /* Don't bother checking for Swing properties if untrusted, as diff --git a/src/java.desktop/share/classes/javax/swing/colorchooser/ColorChooserComponentFactory.java b/src/java.desktop/share/classes/javax/swing/colorchooser/ColorChooserComponentFactory.java index eb3920857a6..f1d012ad178 100644 --- a/src/java.desktop/share/classes/javax/swing/colorchooser/ColorChooserComponentFactory.java +++ b/src/java.desktop/share/classes/javax/swing/colorchooser/ColorChooserComponentFactory.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,6 @@ import javax.swing.JComponent; * * @author Steve Wilson */ -@SuppressWarnings("serial") // Same-version serialization only public class ColorChooserComponentFactory { private ColorChooserComponentFactory() { } // can't instantiate diff --git a/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java b/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java index fb89f725cd0..6e9f9f26b37 100644 --- a/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java +++ b/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java @@ -934,7 +934,6 @@ class WindowsFileSystemView extends FileSystemView { return super.createFileObject(path); } - @SuppressWarnings("serial") // anonymous class protected File createFileSystemRoot(File f) { // Problem: Removable drives on Windows return false on f.exists() // Workaround: Override exists() to always return true. diff --git a/src/java.desktop/share/classes/javax/swing/plaf/LayerUI.java b/src/java.desktop/share/classes/javax/swing/plaf/LayerUI.java index 61fad895c38..00b7cfc0e5d 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/LayerUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/LayerUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -615,7 +615,6 @@ public class LayerUI * baseline */ public int getBaseline(JComponent c, int width, int height) { - @SuppressWarnings("unchecked") JLayer l = (JLayer) c; if (l.getView() != null) { return l.getView().getBaseline(width, height); @@ -633,7 +632,6 @@ public class LayerUI * size changes */ public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c) { - @SuppressWarnings("unchecked") JLayer l = (JLayer) c; if (l.getView() != null) { return l.getView().getBaselineResizeBehavior(); @@ -666,7 +664,6 @@ public class LayerUI * @return preferred size for the passed {@code JLayer} */ public Dimension getPreferredSize(JComponent c) { - @SuppressWarnings("unchecked") JLayer l = (JLayer) c; Component view = l.getView(); if (view != null) { @@ -684,7 +681,6 @@ public class LayerUI * @return minimal size for the passed {@code JLayer} */ public Dimension getMinimumSize(JComponent c) { - @SuppressWarnings("unchecked") JLayer l = (JLayer) c; Component view = l.getView(); if (view != null) { @@ -702,7 +698,6 @@ public class LayerUI * @return maximum size for the passed {@code JLayer} */ public Dimension getMaximumSize(JComponent c) { - @SuppressWarnings("unchecked") JLayer l = (JLayer) c; Component view = l.getView(); if (view != null) { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java index a1bd07282c1..24af28c94c0 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,6 @@ import java.io.Serializable; * * @author Jeff Dinkins */ -@SuppressWarnings("serial") // Same-version serialization only public class BasicCheckBoxUI extends BasicRadioButtonUI { private static final Object BASIC_CHECK_BOX_UI_KEY = new Object(); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java index 0e5eab8285b..b2a8c58eb2e 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java @@ -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. * * 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 java.beans package. * Please see {@link java.beans.XMLEncoder}. */ - @SuppressWarnings("serial") // Same-version serialization only public static class UIResource extends BasicComboBoxEditor implements javax.swing.plaf.UIResource { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index 6be306d5572..2d1a458e0d7 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -1792,12 +1792,9 @@ public class BasicComboBoxUI extends ComboBoxUI { comboBox.revalidate(); } } else { - @SuppressWarnings("unchecked") JComboBox comboBox = (JComboBox)e.getSource(); if ( propertyName == "model" ) { - @SuppressWarnings("unchecked") ComboBoxModel newModel = (ComboBoxModel)e.getNewValue(); - @SuppressWarnings("unchecked") ComboBoxModel oldModel = (ComboBoxModel)e.getOldValue(); if ( oldModel != null && listDataListener != null ) { @@ -2012,7 +2009,6 @@ public class BasicComboBoxUI extends ComboBoxUI { } public void layoutContainer(Container parent) { - @SuppressWarnings("unchecked") JComboBox cb = (JComboBox)parent; int width = cb.getWidth(); int height = cb.getHeight(); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java index 57bd6664e1a..bdce05ae866 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java @@ -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. * * 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()) { JFileChooser chooser = getFileChooser(); FileSystemView fsv = chooser.getFileSystemView(); - @SuppressWarnings("unchecked") JList list = (JList)evt.getSource(); int fsm = chooser.getFileSelectionMode(); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java index 53eb25a76d7..0a4aa03dce9 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java @@ -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. * * 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 #installUI */ - @SuppressWarnings("serial") // Same-version serialization only public class MouseInputHandler implements MouseInputListener { /** @@ -1703,7 +1702,6 @@ public class BasicListUI extends ListUI * @see #getCellBounds * @see #installUI */ - @SuppressWarnings("serial") // Same-version serialization only public class ListSelectionHandler implements ListSelectionListener { /** @@ -1769,7 +1767,6 @@ public class BasicListUI extends ListUI * @see #createListDataListener * @see #installUI */ - @SuppressWarnings("serial") // Same-version serialization only public class ListDataHandler implements ListDataListener { /** @@ -1842,7 +1839,6 @@ public class BasicListUI extends ListUI * @see #createPropertyChangeListener * @see #installUI */ - @SuppressWarnings("serial") // Same-version serialization only 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. */ if (propertyName == "model") { - @SuppressWarnings("unchecked") ListModel oldModel = (ListModel)e.getOldValue(); - @SuppressWarnings("unchecked") ListModel newModel = (ListModel)e.getNewValue(); if (oldModel != null) { oldModel.removeListDataListener(listDataListener); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java index 82547a4e036..2e61967031c 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java @@ -482,7 +482,6 @@ public class BasicOptionPaneUI extends OptionPaneUI { if (nl >= 0) { // break up newlines if (nl == 0) { - @SuppressWarnings("serial") // anonymous class JPanel breakPanel = new JPanel() { public Dimension getPreferredSize() { Font f = getFont(); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java index 119e12276c7..cd59bf8433b 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java @@ -746,7 +746,6 @@ public class BasicSplitPaneDivider extends Container * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ - @SuppressWarnings("serial") // Same-version serialization only protected class DragController { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java index 31d20ab7b93..5ff68f78d38 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java @@ -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. * * 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 */ - @SuppressWarnings("serial") // anonymous class protected Component createDefaultNonContinuousLayoutDivider() { return new Canvas() { public void paint(Graphics g) { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java index 2f5f86f872a..1d7128b7ac9 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,6 @@ import javax.swing.plaf.*; * * @author Timothy Prinzing */ -@SuppressWarnings("serial") // Same-version serialization only public class BasicTextAreaUI extends BasicTextUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java index f3795336207..35c1d0e30b5 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,6 @@ import sun.swing.DefaultLookup; * * @author Timothy Prinzing */ -@SuppressWarnings("serial") // Same-version serialization only public class BasicTextFieldUI extends BasicTextUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextPaneUI.java index a76308dbec6..bf1587f826c 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextPaneUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,6 @@ import javax.swing.border.*; * * @author Timothy Prinzing */ -@SuppressWarnings("serial") // Same-version serialization only public class BasicTextPaneUI extends BasicEditorPaneUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java index e0e1a2e5ed6..41ab6137976 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java @@ -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. * * 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) protected JFrame createFloatingFrame(JToolBar toolbar) { Window window = SwingUtilities.getWindowAncestor(toolbar); - @SuppressWarnings("serial") // anonymous class JFrame frame = new JFrame(toolbar.getName(), (window != null) ? window.getGraphicsConfiguration() : null) { // Override createRootPane() to automatically resize // the frame when contents change protected JRootPane createRootPane() { - @SuppressWarnings("serial") // anonymous class JRootPane rootPane = new JRootPane() { private boolean packing = false; @@ -606,7 +604,6 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants // Override createRootPane() to automatically resize // the frame when contents change protected JRootPane createRootPane() { - @SuppressWarnings("serial") // anonymous class JRootPane rootPane = new JRootPane() { private boolean packing = false; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/ComboPopup.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/ComboPopup.java index 122db235334..71865b4f19f 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/ComboPopup.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/ComboPopup.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,6 @@ import javax.swing.JList; * * @author Tom Santos */ -@SuppressWarnings("serial") // Same-version serialization only public interface ComboPopup { /** * Shows the popup diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java index 3b9c79a8a9a..8ee862fb0b3 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -87,7 +87,6 @@ import sun.swing.SwingUtilities2; * * @author Steve Wilson */ -@SuppressWarnings("serial") // Same-version serialization only public class DefaultMetalTheme extends MetalTheme { /** * Whether or not fonts should be plain. This is only used if diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java index 2a0b1928fb7..0bbbab7b45f 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,6 @@ import javax.swing.plaf.*; * * @author Tom Santos */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalButtonUI extends BasicButtonUI { // NOTE: These are not really needed, but at this point we can't pull diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java index 0470d15718a..558f1987e4d 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java @@ -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. * * 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 * */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalCheckBoxUI extends MetalRadioButtonUI { // NOTE: MetalCheckBoxUI inherits from MetalRadioButtonUI instead diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java index 6765e034452..bac9a821a75 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java @@ -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. * * 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 java.beans package. * Please see {@link java.beans.XMLEncoder}. */ - @SuppressWarnings("serial") // Same-version serialization only public static class UIResource extends MetalComboBoxEditor implements javax.swing.plaf.UIResource { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java index 23803dafde9..a7b8718ca8d 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java @@ -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. * * 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); // CurrentDir ComboBox - @SuppressWarnings("serial") // anonymous class JComboBox tmp1 = new JComboBox() { public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); @@ -381,7 +380,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI { populateFileNameLabel(); fileNamePanel.add(fileNameLabel); - @SuppressWarnings("serial") // anonymous class JTextField tmp2 = new JTextField(35) { public Dimension getMaximumSize() { return new Dimension(Short.MAX_VALUE, super.getPreferredSize().height); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java index 5f316cbb209..b5dddfc1274 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,6 @@ import java.awt.*; * * @author Michael C. Albers */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalProgressBarUI extends BasicProgressBarUI { private Rectangle innards; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java index 8bd1f9acc0a..712046737eb 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java @@ -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. * * 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 Jeff Dinkins (original BasicRadioButtonCode) */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalRadioButtonUI extends BasicRadioButtonUI { private static final Object METAL_RADIO_BUTTON_UI_KEY = new Object(); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java index 81ea2fe28ee..b243c5ca472 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java @@ -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. * * 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 * @since 1.4 */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalRootPaneUI extends BasicRootPaneUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java index e90d8657ae5..e94edc28b65 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,6 @@ import java.awt.event.*; * * @author Steve Wilson */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalScrollPaneUI extends BasicScrollPaneUI { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java index 9140577b895..fe8a45aa979 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java @@ -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. * * 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 */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalSeparatorUI extends BasicSeparatorUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSliderUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSliderUI.java index 03133596822..c31ee81c729 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSliderUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSliderUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,6 @@ import javax.swing.plaf.*; * * @author Tom Santos */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalSliderUI extends BasicSliderUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java index ee888771ff2..aba58db389b 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java @@ -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. * * 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 */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalSplitPaneUI extends BasicSplitPaneUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java index d73ef0d6613..8f9229d4cbd 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java @@ -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. * * 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 */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalTabbedPaneUI extends BasicTabbedPaneUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java index 9a59f99fdce..e7bbc0baf69 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java @@ -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. * * 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 */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalTextFieldUI extends BasicTextFieldUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java index 325f30f7e0a..088a54ba6b2 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,6 @@ import java.io.Serializable; * * @author Tom Santos */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalToggleButtonUI extends BasicToggleButtonUI { private static final Object METAL_TOGGLE_BUTTON_UI_KEY = new Object(); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java index 6cf5314b4a0..258a37b8dbb 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java @@ -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. * * 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 */ -@SuppressWarnings("serial") // Same-version serialization only public class MetalToolTipUI extends BasicToolTipUI { static MetalToolTipUI sharedInstance = new MetalToolTipUI(); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalUtils.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalUtils.java index 5ed2cd9b5ce..79902886848 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalUtils.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalUtils.java @@ -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. * * 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, int x, int y, int w, int h, boolean vertical) { - @SuppressWarnings("unchecked") java.util.List gradient = (java.util.List)UIManager.get(key); if (gradient == null || !(g instanceof Graphics2D)) { return false; @@ -275,7 +274,6 @@ class MetalUtils { protected void paintToImage(Component c, Image image, Graphics g, int w, int h, Object[] args) { Graphics2D g2 = (Graphics2D)g; - @SuppressWarnings("unchecked") java.util.List gradient = (java.util.List)args[0]; boolean isVertical = ((Boolean)args[1]).booleanValue(); // Render to the VolatileImage diff --git a/src/java.desktop/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java b/src/java.desktop/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java index 3862a5ab871..a2d3edd659d 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -56,7 +56,6 @@ import javax.swing.plaf.*; * * @author Willie Walker */ -@SuppressWarnings("serial") // Same-version serialization only public class MultiLookAndFeel extends LookAndFeel { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java index 0b82788032e..23e6e8ec4a3 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -76,7 +76,6 @@ public class SynthDesktopIconUI extends BasicDesktopIconUI @Override protected void installComponents() { if (UIManager.getBoolean("InternalFrame.useTaskBar")) { - @SuppressWarnings("serial") // anonymous class JToggleButton tmp = new JToggleButton(frame.getTitle(), frame.getFrameIcon()) { @Override public String getToolTipText() { return getText(); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java index 52ab14a359f..f8bf123ca89 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -376,7 +376,6 @@ public class SynthScrollBarUI extends BasicScrollBarUI */ @Override protected JButton createDecreaseButton(int orientation) { - @SuppressWarnings("serial") // anonymous class SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) { @Override public boolean contains(int x, int y) { @@ -406,7 +405,6 @@ public class SynthScrollBarUI extends BasicScrollBarUI */ @Override protected JButton createIncreaseButton(int orientation) { - @SuppressWarnings("serial") // anonymous class SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) { @Override public boolean contains(int x, int y) { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java index 49a9689409f..4ac76dec282 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -277,7 +277,6 @@ public class SynthSplitPaneUI extends BasicSplitPaneUI * {@inheritDoc} */ @Override - @SuppressWarnings("serial") // anonymous class protected Component createDefaultNonContinuousLayoutDivider() { return new Canvas() { public void paint(Graphics g) { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java index 3d4c41d9677..956a4ee2fcc 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,6 @@ import java.beans.PropertyChangeEvent; * @author Shannon Hickey * @since 1.7 */ -@SuppressWarnings("serial") // Same-version serialization only public class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI { private Handler handler = new Handler(); private SynthStyle style; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java index 61fd591d9af..02ab78d14e8 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,6 @@ import java.beans.PropertyChangeEvent; * @author Shannon Hickey * @since 1.7 */ -@SuppressWarnings("serial") // Same-version serialization only public class SynthTextFieldUI extends BasicTextFieldUI implements SynthUI { private Handler handler = new Handler(); private SynthStyle style; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java index 4aa5567aa26..c966b979e32 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,6 @@ import java.awt.*; * @author Shannon Hickey * @since 1.7 */ -@SuppressWarnings("serial") // Same-version serialization only public class SynthTextPaneUI extends SynthEditorPaneUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTreeUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTreeUI.java index f9d0d6eb1fa..0e9caf3ebd8 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTreeUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTreeUI.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -771,7 +771,6 @@ public class SynthTreeUI extends BasicTreeUI @Override protected TreeCellEditor createTreeCellEditor() { - @SuppressWarnings("serial") // anonymous class JTextField tf = new JTextField() { @Override public String getName() { diff --git a/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java b/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java index 60ca2d72634..757eccfcd53 100644 --- a/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java +++ b/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java @@ -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. * * 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 java.beans package. * Please see {@link java.beans.XMLEncoder}. */ - @SuppressWarnings("serial") // Same-version serialization only public static class ElementSpec { /** diff --git a/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java b/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java index ce36a5d5a1f..03e04d1c1a7 100644 --- a/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java +++ b/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java @@ -1127,7 +1127,6 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ - @SuppressWarnings("serial") // Same-version serialization only 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 * processInputMethodEvent has been overridden. */ - @SuppressWarnings("removal") private static Cache,Boolean> METHOD_OVERRIDDEN = new Cache,Boolean>(Cache.Kind.WEAK, Cache.Kind.STRONG) { /** diff --git a/src/java.desktop/share/classes/javax/swing/text/SimpleAttributeSet.java b/src/java.desktop/share/classes/javax/swing/text/SimpleAttributeSet.java index 30a47c02a1f..ad6afb14092 100644 --- a/src/java.desktop/share/classes/javax/swing/text/SimpleAttributeSet.java +++ b/src/java.desktop/share/classes/javax/swing/text/SimpleAttributeSet.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,6 @@ import java.util.LinkedHashMap; * * @author Tim Prinzing */ -@SuppressWarnings("serial") // Same-version serialization only public class SimpleAttributeSet implements MutableAttributeSet, Serializable, Cloneable { /** diff --git a/src/java.desktop/share/classes/javax/swing/text/StyledEditorKit.java b/src/java.desktop/share/classes/javax/swing/text/StyledEditorKit.java index e2630c93623..636196de69c 100644 --- a/src/java.desktop/share/classes/javax/swing/text/StyledEditorKit.java +++ b/src/java.desktop/share/classes/javax/swing/text/StyledEditorKit.java @@ -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. * * 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. */ - @SuppressWarnings("serial") // anonymous class private void createInputAttributes() { inputAttributes = new SimpleAttributeSet() { public AttributeSet getResolveParent() { diff --git a/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java b/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java index 8d6980eaaea..0bceae3acee 100644 --- a/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java +++ b/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java @@ -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. * * 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 * @return the break position */ - @SuppressWarnings("deprecation") protected int calculateBreakPosition(int p0, int p1) { int p; Segment segment = SegmentCache.getSharedSegment(); @@ -798,7 +797,6 @@ public class WrappedPlainView extends BoxView implements TabExpander { * given point in the view * @see View#viewToModel */ - @SuppressWarnings("deprecation") public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) { // PENDING(prinz) implement bias properly bias[0] = Position.Bias.Forward; diff --git a/src/java.desktop/share/classes/javax/swing/text/html/FormView.java b/src/java.desktop/share/classes/javax/swing/text/html/FormView.java index 8af4f9e2f1e..47f10e1abb2 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/FormView.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/FormView.java @@ -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. * * 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. // For JComboBox, there are 2 stale ListDataListeners, which are // BasicListUI$Handler and BasicComboBoxUI$Handler. - @SuppressWarnings("unchecked") AbstractListModel listModel = (AbstractListModel) model; String listenerClass1 = "javax.swing.plaf.basic.BasicListUI$Handler"; @@ -850,7 +849,6 @@ public class FormView extends ComponentView implements ActionListener { } } } else if (m instanceof ComboBoxModel) { - @SuppressWarnings("unchecked") ComboBoxModel model = (ComboBoxModel)m; Option option = (Option)model.getSelectedItem(); if (option != null) { @@ -962,7 +960,6 @@ public class FormView extends ComponentView implements ActionListener { } catch (BadLocationException e) { } } else if (m instanceof OptionListModel) { - @SuppressWarnings("unchecked") OptionListModel model = (OptionListModel) m; int size = model.getSize(); for (int i = 0; i < size; i++) { @@ -975,7 +972,6 @@ public class FormView extends ComponentView implements ActionListener { } } } else if (m instanceof OptionComboBoxModel) { - @SuppressWarnings("unchecked") OptionComboBoxModel model = (OptionComboBoxModel) m; Option option = model.getInitialSelection(); if (option != null) { diff --git a/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java b/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java index d3435231e7f..97383785dca 100644 --- a/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java +++ b/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,6 @@ import java.util.Enumeration; * * @author Scott Violet */ -@SuppressWarnings("serial") // Same-version serialization only public abstract class AbstractLayoutCache implements RowMapper { /** Object responsible for getting the size of a node. */ protected NodeDimensions nodeDimensions; diff --git a/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellEditor.java b/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellEditor.java index 2397f51f7a6..4662c95c01f 100644 --- a/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellEditor.java +++ b/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellEditor.java @@ -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. * * 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() { Border aBorder = UIManager.getBorder("Tree.editorBorder"); - @SuppressWarnings("serial") // Safe: outer class is non-serializable DefaultCellEditor editor = new DefaultCellEditor (new DefaultTextField(aBorder)) { public boolean shouldSelectCell(EventObject event) { diff --git a/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java b/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java index e944d19e1c1..5a81de507db 100644 --- a/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java +++ b/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java @@ -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. * * 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() { return new AWTEvent(getInstance(), 0) { }; diff --git a/src/java.desktop/share/classes/sun/awt/AppContext.java b/src/java.desktop/share/classes/sun/awt/AppContext.java index 48482dfc39a..a35d89f6a0c 100644 --- a/src/java.desktop/share/classes/sun/awt/AppContext.java +++ b/src/java.desktop/share/classes/sun/awt/AppContext.java @@ -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. * * 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 * @since 1.2 */ - @SuppressWarnings("deprecation") public void dispose() throws IllegalThreadStateException { System.err.println( """ diff --git a/src/java.desktop/share/classes/sun/awt/CausedFocusEvent.java b/src/java.desktop/share/classes/sun/awt/CausedFocusEvent.java index 2527eda11f6..a6293d4efea 100644 --- a/src/java.desktop/share/classes/sun/awt/CausedFocusEvent.java +++ b/src/java.desktop/share/classes/sun/awt/CausedFocusEvent.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,6 @@ class CausedFocusEvent extends FocusEvent { RETARGETED } - @SuppressWarnings("serial") private static final Component dummy = new Component(){}; private final Cause cause; diff --git a/src/java.desktop/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java b/src/java.desktop/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java index 86b957398f7..ef50d883ee5 100644 --- a/src/java.desktop/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java +++ b/src/java.desktop/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java @@ -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. * * 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. */ - @SuppressWarnings("deprecation") public static boolean deliverFocus(Component lightweightChild, Component target, boolean temporary, diff --git a/src/java.desktop/share/classes/sun/awt/LightweightFrame.java b/src/java.desktop/share/classes/sun/awt/LightweightFrame.java index cd1cdf3ebd5..205b8034b7e 100644 --- a/src/java.desktop/share/classes/sun/awt/LightweightFrame.java +++ b/src/java.desktop/share/classes/sun/awt/LightweightFrame.java @@ -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. * * 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 toBack() {} - @SuppressWarnings("deprecation") @Override public void addNotify() { synchronized (getTreeLock()) { if (!isDisplayable()) { diff --git a/src/java.desktop/share/classes/sun/awt/SunToolkit.java b/src/java.desktop/share/classes/sun/awt/SunToolkit.java index 355ee995c8c..5c4ebda8715 100644 --- a/src/java.desktop/share/classes/sun/awt/SunToolkit.java +++ b/src/java.desktop/share/classes/sun/awt/SunToolkit.java @@ -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. * * 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 * the time of the ActionEvent */ - @SuppressWarnings("serial") public static void executeOnEventHandlerThread(Object target, Runnable runnable, final long when) { @@ -1569,7 +1568,6 @@ public abstract class SunToolkit extends Toolkit * Should return {@code true} if more processing is * necessary, {@code false} otherwise. */ - @SuppressWarnings("serial") private final boolean waitForIdle(final long end) { if (timeout(end) <= 0) { return false; diff --git a/src/java.desktop/share/classes/sun/java2d/Disposer.java b/src/java.desktop/share/classes/sun/java2d/Disposer.java index 5a80a616045..5692b490278 100644 --- a/src/java.desktop/share/classes/sun/java2d/Disposer.java +++ b/src/java.desktop/share/classes/sun/java2d/Disposer.java @@ -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. * * 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 * the reference queue. */ - @SuppressWarnings("unchecked") public static void addReference(Reference ref, DisposerRecord rec) { records.put(ref, rec); } diff --git a/src/java.desktop/share/classes/sun/java2d/marlin/DMarlinRenderingEngine.java b/src/java.desktop/share/classes/sun/java2d/marlin/DMarlinRenderingEngine.java index a42e474e764..b29cc84c127 100644 --- a/src/java.desktop/share/classes/sun/java2d/marlin/DMarlinRenderingEngine.java +++ b/src/java.desktop/share/classes/sun/java2d/marlin/DMarlinRenderingEngine.java @@ -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. * * 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 * @return RendererContext instance */ - @SuppressWarnings({"unchecked"}) static RendererContext getRendererContext() { final RendererContext rdrCtx = RDR_CTX_PROVIDER.acquire(); if (DO_MONITORS) { diff --git a/src/java.desktop/share/classes/sun/print/ServiceDialog.java b/src/java.desktop/share/classes/sun/print/ServiceDialog.java index 6f2bdecb809..983be70bdbb 100644 --- a/src/java.desktop/share/classes/sun/print/ServiceDialog.java +++ b/src/java.desktop/share/classes/sun/print/ServiceDialog.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -296,7 +296,6 @@ public class ServiceDialog extends JDialog implements ActionListener { * Performs Cancel when Esc key is pressed. */ private void handleEscKey(JButton btnCancel) { - @SuppressWarnings("serial") // anonymous class Action cancelKeyAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { dispose(CANCEL); diff --git a/src/java.desktop/share/classes/sun/swing/FilePane.java b/src/java.desktop/share/classes/sun/swing/FilePane.java index e97dcb3b881..395cf058b7d 100644 --- a/src/java.desktop/share/classes/sun/swing/FilePane.java +++ b/src/java.desktop/share/classes/sun/swing/FilePane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, 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. * * This code is free software; you can redistribute it and/or modify it @@ -659,7 +659,6 @@ public class FilePane extends JPanel implements PropertyChangeListener { JPanel p = new JPanel(new BorderLayout()); final JFileChooser fileChooser = getFileChooser(); - @SuppressWarnings("serial") // anonymous class final JList list = new JList() { public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { ListModel model = getModel(); @@ -1262,7 +1261,6 @@ public class FilePane extends JPanel implements PropertyChangeListener { JPanel p = new JPanel(new BorderLayout()); - @SuppressWarnings("serial") // anonymous class final JTable detailsTable = new JTable(getDetailsTableModel()) { // Handle Escape key events here protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { @@ -1575,7 +1573,6 @@ public class FilePane extends JPanel implements PropertyChangeListener { protected Action newFolderAction; - @SuppressWarnings("serial") // anonymous class inside public Action getNewFolderAction() { if (!readOnly && newFolderAction == null) { newFolderAction = new AbstractAction(newFolderActionLabelText) { diff --git a/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java b/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java index cfc5ceef6c3..d83b940a0bd 100644 --- a/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java +++ b/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, 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. * * This code is free software; you can redistribute it and/or modify it @@ -331,7 +331,7 @@ public final class JLightweightFrame extends LightweightFrame implements RootPan content.imageUpdated(x, y, width, height); } - @SuppressWarnings({"removal","serial"}) // anonymous class inside + @SuppressWarnings("removal") private void initInterior() { contentPane = new JPanel() { @Override diff --git a/src/java.desktop/share/classes/sun/swing/LightweightContent.java b/src/java.desktop/share/classes/sun/swing/LightweightContent.java index eb283908e81..f67e3ad7fcf 100644 --- a/src/java.desktop/share/classes/sun/swing/LightweightContent.java +++ b/src/java.desktop/share/classes/sun/swing/LightweightContent.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -161,7 +161,6 @@ public interface LightweightContent { * @param scaleY the y coordinate scale factor of the pixel buffer * @since 9 */ - @SuppressWarnings("deprecation") default public void imageBufferReset(int[] data, int x, int y, int width, int height, @@ -178,7 +177,6 @@ public interface LightweightContent { * default implementations in order to allow a client application to run * with any JDK version without breaking backward compatibility. */ - @SuppressWarnings("deprecation") default public void imageBufferReset(int[] data, int x, int y, int width, int height, diff --git a/src/java.desktop/share/classes/sun/swing/PrintingStatus.java b/src/java.desktop/share/classes/sun/swing/PrintingStatus.java index 1f7358a2881..b2fbed5222e 100644 --- a/src/java.desktop/share/classes/sun/swing/PrintingStatus.java +++ b/src/java.desktop/share/classes/sun/swing/PrintingStatus.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, 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. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,6 @@ public class PrintingStatus { private final AtomicBoolean isAborted = new AtomicBoolean(false); // the action that will abort printing - @SuppressWarnings("serial") // anonymous class private final Action abortAction = new AbstractAction() { public void actionPerformed(ActionEvent ae) { if (!isAborted.get()) { diff --git a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java index 81789bcfdcf..c225ddc9ff6 100644 --- a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java +++ b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, 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. * * This code is free software; you can redistribute it and/or modify it @@ -188,7 +188,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI { readOnly = UIManager.getBoolean("FileChooser.readOnly"); } - @SuppressWarnings("serial") // anonymous classes inside public void installComponents(JFileChooser fc) { super.installComponents(fc); diff --git a/src/java.desktop/share/classes/sun/swing/text/TextComponentPrintable.java b/src/java.desktop/share/classes/sun/swing/text/TextComponentPrintable.java index 28d57b02b63..f93c1673aca 100644 --- a/src/java.desktop/share/classes/sun/swing/text/TextComponentPrintable.java +++ b/src/java.desktop/share/classes/sun/swing/text/TextComponentPrintable.java @@ -332,7 +332,6 @@ public class TextComponentPrintable implements CountingPrintable { } } - @SuppressWarnings("serial") // anonymous class inside private JTextComponent createPrintShellOnEDT(final JTextComponent textComponent) { assert SwingUtilities.isEventDispatchThread();