Skip to content

Commit

Permalink
8346953: Remove unnecessary @SuppressWarnings annotations (client, #2)
Browse files Browse the repository at this point in the history
Reviewed-by: azvegint
  • Loading branch information
archiecobbs committed Jan 6, 2025
1 parent 9a60f44 commit 9c393a2
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -621,7 +621,6 @@ public void installComponents(JFileChooser fc) {

fc.add(interior, BorderLayout.CENTER);

@SuppressWarnings("serial") // anonymous class
JPanel comboBoxPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,
0, 0) {
public void layoutContainer(Container target) {
Expand Down Expand Up @@ -733,7 +732,6 @@ public void layoutContainer(Container target) {
if (currentDirectory != null) {
curDirName = currentDirectory.getPath();
}
@SuppressWarnings("serial") // anonymous class
JLabel tmp = new JLabel(curDirName) {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
Expand All @@ -748,7 +746,6 @@ public Dimension getMaximumSize() {
interior.add(pathFieldPanel);

// add the fileName field
@SuppressWarnings("serial") // anonymous class
JTextField tmp2 = new JTextField() {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -168,7 +168,6 @@ public boolean isReparentSupported() {
return System.getProperty("sun.awt.X11.XComponentPeer.reparentNotSupported", "false").equals("false");
}

@SuppressWarnings("deprecation")
public boolean isObscured() {
Container container = (target instanceof Container) ?
(Container)target : target.getParent();
Expand Down Expand Up @@ -244,7 +243,6 @@ static final AWTEvent wrapInSequenced(AWTEvent event) {
}

// TODO: consider moving it to KeyboardFocusManagerPeerImpl
@SuppressWarnings("deprecation")
public final boolean requestFocus(Component lightweightChild, boolean temporary,
boolean focusedWindowChangeAllowed, long time,
FocusEvent.Cause cause)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -197,7 +197,6 @@ private void init(FileDialog target) {
// After showing we should display 'user.dir' as current directory
// if user didn't set directory programmatically
pathField = new TextField(savedDir != null ? savedDir : userDir);
@SuppressWarnings("serial") // Anonymous class
Choice tmp = new Choice() {
public Dimension getPreferredSize() {
return new Dimension(PATH_CHOICE_WIDTH, pathField.getPreferredSize().height);
Expand Down Expand Up @@ -778,7 +777,6 @@ public void dispose() {
}

// 03/02/2005 b5097243 Pressing 'ESC' on a file dlg does not dispose the dlg on Xtoolkit
@SuppressWarnings("deprecation")
public void setVisible(boolean b){
if (fileDialog == null) {
init(target);
Expand Down
3 changes: 1 addition & 2 deletions src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -137,7 +137,6 @@ void setupState(boolean onInit) {
setExtendedState(state);
}

@SuppressWarnings("deprecation")
public void setMenuBar(MenuBar mb) {
// state_lock should always be the second after awt_lock
XToolkit.awtLock();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -83,7 +83,6 @@ public int fillPointWithCoords(Point point) {
return 0;
}

@SuppressWarnings("deprecation")
public boolean isWindowUnderMouse(Window w) {
if (w == null) {
return false;
Expand Down
3 changes: 1 addition & 2 deletions src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -214,7 +214,6 @@ protected String getWMName() {
private static native String getLocalHostname();
private static native int getJvmPID();

@SuppressWarnings("deprecation")
void postInit(XCreateWindowParams params) {
super.postInit(params);

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

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

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

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

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

@SuppressWarnings("serial") // anonymous class
JButton tmp5 = new JButton(cancelButtonText) {
public Dimension getMaximumSize() {
return approveButton.getPreferredSize().width > cancelButton.getPreferredSize().width ?
Expand Down Expand Up @@ -974,7 +969,6 @@ protected DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser
return new DirectoryComboBoxRenderer();
}

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -289,7 +289,6 @@ protected void assembleSystemMenu() {
systemPopupMenu = new JPopupMenu();
addSystemMenuItems(systemPopupMenu);
enableActions();
@SuppressWarnings("serial") // anonymous class
JLabel tmp = new JLabel(frame.getFrameIcon()) {
protected void paintComponent(Graphics g) {
int x = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -94,7 +94,6 @@ protected void realShow() {
}

@Override
@SuppressWarnings("deprecation")
void hide() {
Dialog dlg = (Dialog)target;
if (dlg.getModalityType() != Dialog.ModalityType.MODELESS) {
Expand Down

0 comments on commit 9c393a2

Please sign in to comment.