Skip to content

Commit 9c393a2

Browse files
committed
8346953: Remove unnecessary @SuppressWarnings annotations (client, #2)
Reviewed-by: azvegint
1 parent 9a60f44 commit 9c393a2

File tree

9 files changed

+9
-27
lines changed

9 files changed

+9
-27
lines changed

src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -621,7 +621,6 @@ public void installComponents(JFileChooser fc) {
621621

622622
fc.add(interior, BorderLayout.CENTER);
623623

624-
@SuppressWarnings("serial") // anonymous class
625624
JPanel comboBoxPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,
626625
0, 0) {
627626
public void layoutContainer(Container target) {
@@ -733,7 +732,6 @@ public void layoutContainer(Container target) {
733732
if (currentDirectory != null) {
734733
curDirName = currentDirectory.getPath();
735734
}
736-
@SuppressWarnings("serial") // anonymous class
737735
JLabel tmp = new JLabel(curDirName) {
738736
public Dimension getMaximumSize() {
739737
Dimension d = super.getMaximumSize();
@@ -748,7 +746,6 @@ public Dimension getMaximumSize() {
748746
interior.add(pathFieldPanel);
749747

750748
// add the fileName field
751-
@SuppressWarnings("serial") // anonymous class
752749
JTextField tmp2 = new JTextField() {
753750
public Dimension getMaximumSize() {
754751
Dimension d = super.getMaximumSize();

src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -168,7 +168,6 @@ public boolean isReparentSupported() {
168168
return System.getProperty("sun.awt.X11.XComponentPeer.reparentNotSupported", "false").equals("false");
169169
}
170170

171-
@SuppressWarnings("deprecation")
172171
public boolean isObscured() {
173172
Container container = (target instanceof Container) ?
174173
(Container)target : target.getParent();
@@ -244,7 +243,6 @@ static final AWTEvent wrapInSequenced(AWTEvent event) {
244243
}
245244

246245
// TODO: consider moving it to KeyboardFocusManagerPeerImpl
247-
@SuppressWarnings("deprecation")
248246
public final boolean requestFocus(Component lightweightChild, boolean temporary,
249247
boolean focusedWindowChangeAllowed, long time,
250248
FocusEvent.Cause cause)

src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -197,7 +197,6 @@ private void init(FileDialog target) {
197197
// After showing we should display 'user.dir' as current directory
198198
// if user didn't set directory programmatically
199199
pathField = new TextField(savedDir != null ? savedDir : userDir);
200-
@SuppressWarnings("serial") // Anonymous class
201200
Choice tmp = new Choice() {
202201
public Dimension getPreferredSize() {
203202
return new Dimension(PATH_CHOICE_WIDTH, pathField.getPreferredSize().height);
@@ -778,7 +777,6 @@ public void dispose() {
778777
}
779778

780779
// 03/02/2005 b5097243 Pressing 'ESC' on a file dlg does not dispose the dlg on Xtoolkit
781-
@SuppressWarnings("deprecation")
782780
public void setVisible(boolean b){
783781
if (fileDialog == null) {
784782
init(target);

src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -137,7 +137,6 @@ void setupState(boolean onInit) {
137137
setExtendedState(state);
138138
}
139139

140-
@SuppressWarnings("deprecation")
141140
public void setMenuBar(MenuBar mb) {
142141
// state_lock should always be the second after awt_lock
143142
XToolkit.awtLock();

src/java.desktop/unix/classes/sun/awt/X11/XMouseInfoPeer.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,6 @@ public int fillPointWithCoords(Point point) {
8383
return 0;
8484
}
8585

86-
@SuppressWarnings("deprecation")
8786
public boolean isWindowUnderMouse(Window w) {
8887
if (w == null) {
8988
return false;

src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -214,7 +214,6 @@ protected String getWMName() {
214214
private static native String getLocalHostname();
215215
private static native int getJvmPID();
216216

217-
@SuppressWarnings("deprecation")
218217
void postInit(XCreateWindowParams params) {
219218
super.postInit(params);
220219

src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -273,7 +273,6 @@ public void installComponents(JFileChooser fc) {
273273
fc.add(topPanel, BorderLayout.NORTH);
274274

275275
// ComboBox Label
276-
@SuppressWarnings("serial") // anonymous class
277276
JLabel tmp1 = new JLabel(lookInLabelText, JLabel.TRAILING) {
278277
public Dimension getPreferredSize() {
279278
return getMinimumSize();
@@ -295,7 +294,6 @@ public Dimension getMinimumSize() {
295294
topPanel.add(Box.createRigidArea(new Dimension(8,0)));
296295

297296
// CurrentDir ComboBox
298-
@SuppressWarnings("serial") // anonymous class
299297
JComboBox<File> tmp2 = new JComboBox<File>() {
300298
public Dimension getMinimumSize() {
301299
Dimension d = super.getMinimumSize();
@@ -477,7 +475,6 @@ public void propertyChange(PropertyChangeEvent e) {
477475
fileAndFilterPanel.add(Box.createRigidArea(vstrut8));
478476
fileAndFilterPanel.setLayout(new BoxLayout(fileAndFilterPanel, BoxLayout.Y_AXIS));
479477

480-
@SuppressWarnings("serial") // anonymous class
481478
JTextField tmp3 = new JTextField(35) {
482479
public Dimension getMaximumSize() {
483480
return new Dimension(Short.MAX_VALUE, super.getPreferredSize().height);
@@ -518,7 +515,6 @@ public void focusGained(FocusEvent e) {
518515
// buttons
519516
getButtonPanel().setLayout(new BoxLayout(getButtonPanel(), BoxLayout.Y_AXIS));
520517

521-
@SuppressWarnings("serial") // anonymous class
522518
JButton tmp4 = new JButton(getApproveButtonText(fc)) {
523519
public Dimension getMaximumSize() {
524520
return approveButton.getPreferredSize().width > cancelButton.getPreferredSize().width ?
@@ -537,7 +533,6 @@ public Dimension getMaximumSize() {
537533
getButtonPanel().add(approveButton);
538534
getButtonPanel().add(Box.createRigidArea(vstrut4));
539535

540-
@SuppressWarnings("serial") // anonymous class
541536
JButton tmp5 = new JButton(cancelButtonText) {
542537
public Dimension getMaximumSize() {
543538
return approveButton.getPreferredSize().width > cancelButton.getPreferredSize().width ?
@@ -974,7 +969,6 @@ protected DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser
974969
return new DirectoryComboBoxRenderer();
975970
}
976971

977-
@SuppressWarnings("serial") // anonymous class
978972
private static JButton createToolButton(Action a, Icon defaultIcon, String toolTipText, String accessibleName) {
979973
final JButton result = new JButton(a);
980974

src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -289,7 +289,6 @@ protected void assembleSystemMenu() {
289289
systemPopupMenu = new JPopupMenu();
290290
addSystemMenuItems(systemPopupMenu);
291291
enableActions();
292-
@SuppressWarnings("serial") // anonymous class
293292
JLabel tmp = new JLabel(frame.getFrameIcon()) {
294293
protected void paintComponent(Graphics g) {
295294
int x = 0;

src/java.desktop/windows/classes/sun/awt/windows/WDialogPeer.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,6 @@ protected void realShow() {
9494
}
9595

9696
@Override
97-
@SuppressWarnings("deprecation")
9897
void hide() {
9998
Dialog dlg = (Dialog)target;
10099
if (dlg.getModalityType() != Dialog.ModalityType.MODELESS) {

0 commit comments

Comments
 (0)