Compare commits

..

No commits in common. "98c3bff8ceaab165e26a1f7b84ddaf1cd2d7d5c0" and "bc7eabd7e4c499fc1b1f37b958c7384078b69bce" have entirely different histories.

143 changed files with 773 additions and 527 deletions

View File

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

View File

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

View File

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

View File

@ -393,13 +393,7 @@ void InterpreterMacroAssembler::dispatch_base(TosState state,
bool verifyoop, bool verifyoop,
bool generate_poll) { bool generate_poll) {
if (VerifyActivationFrameSize) { if (VerifyActivationFrameSize) {
Label L; Unimplemented();
sub(rscratch2, rfp, esp);
int min_frame_size = (frame::link_offset - frame::interpreter_frame_initial_sp_offset) * wordSize;
subs(rscratch2, rscratch2, min_frame_size);
br(Assembler::GE, L);
stop("broken stack frame");
bind(L);
} }
if (verifyoop) { if (verifyoop) {
interp_verify_oop(r0, state); interp_verify_oop(r0, state);

View File

@ -150,12 +150,11 @@ void VM_Version::common_initialize() {
} }
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) { if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) {
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, if (unaligned_access.value() != MISALIGNED_FAST) {
unaligned_access.value() != MISALIGNED_FAST); FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true);
} } else {
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, false);
if (FLAG_IS_DEFAULT(AlignVector)) { }
FLAG_SET_DEFAULT(AlignVector, AvoidUnalignedAccesses);
} }
// See JDK-8026049 // See JDK-8026049

View File

@ -218,10 +218,10 @@ SaveLiveRegisters::SaveLiveRegisters(MacroAssembler *masm, BarrierStubC2 *stub)
const int register_save_size = iterate_over_register_mask(ACTION_COUNT_ONLY) * BytesPerWord; const int register_save_size = iterate_over_register_mask(ACTION_COUNT_ONLY) * BytesPerWord;
_frame_size = align_up(register_save_size, frame::alignment_in_bytes) + frame::z_abi_160_size; _frame_size = align_up(register_save_size, frame::alignment_in_bytes) + frame::z_abi_160_size; // FIXME: this could be restricted to argument only
__ save_return_pc(); __ save_return_pc();
__ push_frame(_frame_size, Z_R14); __ push_frame(_frame_size, Z_R14); // FIXME: check if Z_R1_scaratch can do a job here;
__ z_lg(Z_R14, _z_common_abi(return_pc) + _frame_size, Z_SP); __ z_lg(Z_R14, _z_common_abi(return_pc) + _frame_size, Z_SP);
@ -240,7 +240,6 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
int reg_save_index = 0; int reg_save_index = 0;
RegMaskIterator live_regs_iterator(_reg_mask); RegMaskIterator live_regs_iterator(_reg_mask);
// Going to preserve the volatile registers which can be used by Register Allocator.
while(live_regs_iterator.has_next()) { while(live_regs_iterator.has_next()) {
const OptoReg::Name opto_reg = live_regs_iterator.next(); const OptoReg::Name opto_reg = live_regs_iterator.next();
@ -252,11 +251,8 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
const VMReg vm_reg = OptoReg::as_VMReg(opto_reg); const VMReg vm_reg = OptoReg::as_VMReg(opto_reg);
if (vm_reg->is_Register()) { if (vm_reg->is_Register()) {
Register std_reg = vm_reg->as_Register(); Register std_reg = vm_reg->as_Register();
// Z_R0 and Z_R1 will not be allocated by the register allocator, see s390.ad (Integer Register Classes)
// Z_R6 to Z_R15 are saved registers, except Z_R14 (see Z-Abi) if (std_reg->encoding() >= Z_R2->encoding() && std_reg->encoding() <= Z_R15->encoding()) {
if (std_reg->encoding() == Z_R14->encoding() ||
(std_reg->encoding() >= Z_R2->encoding() &&
std_reg->encoding() <= Z_R5->encoding())) {
reg_save_index++; reg_save_index++;
if (action == ACTION_SAVE) { if (action == ACTION_SAVE) {
@ -269,10 +265,8 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
} }
} else if (vm_reg->is_FloatRegister()) { } else if (vm_reg->is_FloatRegister()) {
FloatRegister fp_reg = vm_reg->as_FloatRegister(); FloatRegister fp_reg = vm_reg->as_FloatRegister();
// Z_R1 will not be allocated by the register allocator, see s390.ad (Float Register Classes) if (fp_reg->encoding() >= Z_F0->encoding() && fp_reg->encoding() <= Z_F15->encoding()
if (fp_reg->encoding() >= Z_F0->encoding() && && fp_reg->encoding() != Z_F1->encoding()) {
fp_reg->encoding() <= Z_F7->encoding() &&
fp_reg->encoding() != Z_F1->encoding()) {
reg_save_index++; reg_save_index++;
if (action == ACTION_SAVE) { if (action == ACTION_SAVE) {
@ -283,20 +277,8 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
assert(action == ACTION_COUNT_ONLY, "Sanity"); assert(action == ACTION_COUNT_ONLY, "Sanity");
} }
} }
} else if (vm_reg->is_VectorRegister()) { } else if (false /* vm_reg->is_VectorRegister() */){
VectorRegister vs_reg = vm_reg->as_VectorRegister(); fatal("Vector register support is not there yet!");
// Z_V0 to Z_V15 will not be allocated by the register allocator, see s390.ad (reg class z_v_reg)
if (vs_reg->encoding() >= Z_V16->encoding() &&
vs_reg->encoding() <= Z_V31->encoding()) {
reg_save_index += 2;
if (action == ACTION_SAVE) {
__ z_vst(vs_reg, Address(Z_SP, offset - reg_save_index * BytesPerWord));
} else if (action == ACTION_RESTORE) {
__ z_vl(vs_reg, Address(Z_SP, offset - reg_save_index * BytesPerWord));
} else {
assert(action == ACTION_COUNT_ONLY, "Sanity");
}
}
} else { } else {
fatal("Register type is not known"); fatal("Register type is not known");
} }

View File

@ -140,8 +140,7 @@ LIR_Opr BarrierSetC1::atomic_add_at(LIRAccess& access, LIRItem& value) {
void BarrierSetC1::store_at_resolved(LIRAccess& access, LIR_Opr value) { void BarrierSetC1::store_at_resolved(LIRAccess& access, LIR_Opr value) {
DecoratorSet decorators = access.decorators(); DecoratorSet decorators = access.decorators();
bool is_volatile = (decorators & MO_SEQ_CST) != 0; bool is_volatile = (((decorators & MO_SEQ_CST) != 0) || AlwaysAtomicAccesses);
bool is_atomic = is_volatile || AlwaysAtomicAccesses;
bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0; bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0;
bool mask_boolean = (decorators & C1_MASK_BOOLEAN) != 0; bool mask_boolean = (decorators & C1_MASK_BOOLEAN) != 0;
LIRGenerator* gen = access.gen(); LIRGenerator* gen = access.gen();
@ -155,7 +154,7 @@ void BarrierSetC1::store_at_resolved(LIRAccess& access, LIR_Opr value) {
} }
LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none; LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none;
if (is_atomic && !needs_patching) { if (is_volatile && !needs_patching) {
gen->volatile_field_store(value, access.resolved_addr()->as_address_ptr(), access.access_emit_info()); gen->volatile_field_store(value, access.resolved_addr()->as_address_ptr(), access.access_emit_info());
} else { } else {
__ store(value, access.resolved_addr()->as_address_ptr(), access.access_emit_info(), patch_code); __ store(value, access.resolved_addr()->as_address_ptr(), access.access_emit_info(), patch_code);
@ -169,8 +168,7 @@ void BarrierSetC1::store_at_resolved(LIRAccess& access, LIR_Opr value) {
void BarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) { void BarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) {
LIRGenerator *gen = access.gen(); LIRGenerator *gen = access.gen();
DecoratorSet decorators = access.decorators(); DecoratorSet decorators = access.decorators();
bool is_volatile = (decorators & MO_SEQ_CST) != 0; bool is_volatile = (((decorators & MO_SEQ_CST) != 0) || AlwaysAtomicAccesses);
bool is_atomic = is_volatile || AlwaysAtomicAccesses;
bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0; bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0;
bool mask_boolean = (decorators & C1_MASK_BOOLEAN) != 0; bool mask_boolean = (decorators & C1_MASK_BOOLEAN) != 0;
bool in_native = (decorators & IN_NATIVE) != 0; bool in_native = (decorators & IN_NATIVE) != 0;
@ -182,7 +180,7 @@ void BarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) {
LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none; LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none;
if (in_native) { if (in_native) {
__ move_wide(access.resolved_addr()->as_address_ptr(), result); __ move_wide(access.resolved_addr()->as_address_ptr(), result);
} else if (is_atomic && !needs_patching) { } else if (is_volatile && !needs_patching) {
gen->volatile_field_load(access.resolved_addr()->as_address_ptr(), result, access.access_emit_info()); gen->volatile_field_load(access.resolved_addr()->as_address_ptr(), result, access.access_emit_info());
} else { } else {
__ load(access.resolved_addr()->as_address_ptr(), result, access.access_emit_info(), patch_code); __ load(access.resolved_addr()->as_address_ptr(), result, access.access_emit_info(), patch_code);

View File

@ -287,8 +287,11 @@ public class AccessibleObject implements AnnotatedElement {
if (caller == null) { if (caller == null) {
// No caller frame when a native thread attaches to the VM // No caller frame when a native thread attaches to the VM
// only allow access to a public accessible member // only allow access to a public accessible member
boolean canAccess = Reflection.verifyPublicMemberAccess(declaringClass, declaringClass.getModifiers());
return true; if (!canAccess && throwExceptionIfDenied) {
throwInaccessibleObjectException(caller, declaringClass);
}
return canAccess;
} }
Module callerModule = caller.getModule(); Module callerModule = caller.getModule();
@ -322,7 +325,10 @@ public class AccessibleObject implements AnnotatedElement {
return true; return true;
} }
return true; if (throwExceptionIfDenied) {
throwInaccessibleObjectException(caller, declaringClass);
}
return false;
} }
private void throwInaccessibleObjectException(Class<?> caller, Class<?> declaringClass) { private void throwInaccessibleObjectException(Class<?> caller, Class<?> declaringClass) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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