Skip to content

Commit ebb68d2

Browse files
committed
8049700: Deprecate obsolete classes and methods in javax/swing/plaf/basic
Reviewed-by: psadhukhan, prr, serb, azvegint, iris
1 parent 3a474d9 commit ebb68d2

File tree

4 files changed

+38
-7
lines changed

4 files changed

+38
-7
lines changed

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -224,16 +224,20 @@ public Object getElementAt(int index) {
224224
}
225225

226226
/**
227-
* Obsolete - not used.
227+
* Obsolete - not used. This method is a no-op.
228228
* @param e list data event
229+
* @deprecated Obsolete method, not used anymore.
229230
*/
231+
@Deprecated(since = "17")
230232
public void intervalAdded(ListDataEvent e) {
231233
}
232234

233235
/**
234-
* Obsolete - not used.
236+
* Obsolete - not used. This method is a no-op.
235237
* @param e list data event
238+
* @deprecated Obsolete method, not used anymore.
236239
*/
240+
@Deprecated(since = "17")
237241
public void intervalRemoved(ListDataEvent e) {
238242
}
239243

@@ -251,7 +255,9 @@ protected void sort(Vector<? extends File> v){
251255
* @return a comparison of the file names
252256
* @param a a file
253257
* @param b another file
258+
* @deprecated Obsolete method, not used anymore.
254259
*/
260+
@Deprecated(since = "17")
255261
protected boolean lt(File a, File b) {
256262
// First ignore case when comparing
257263
int diff = a.getName().toLowerCase().compareTo(b.getName().toLowerCase());

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -921,7 +921,13 @@ else if (me == null)
921921
if (dumpStack == true)
922922
Thread.dumpStack();
923923
}
924-
/** Mouse input handler */
924+
/**
925+
* Mouse input handler.
926+
* This class exists only for backward compatibility.
927+
* All its functionality has been moved into Handler.
928+
* @deprecated
929+
*/
930+
@Deprecated(since = "17")
925931
protected class MouseInputHandler implements MouseInputListener {
926932
// NOTE: This class exists only for backward compatibility. All
927933
// its functionality has been moved into Handler. If you need to add

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -496,7 +496,11 @@ public Component.BaselineResizeBehavior getBaselineResizeBehavior(
496496

497497
/**
498498
* Listener for viewport events.
499+
* This class exists only for backward compatibility.
500+
* All its functionality has been moved into Handler.
501+
* @deprecated
499502
*/
503+
@Deprecated(since = "17")
500504
public class ViewportChangeHandler implements ChangeListener
501505
{
502506
/**
@@ -526,7 +530,11 @@ protected ChangeListener createViewportChangeListener() {
526530

527531
/**
528532
* Horizontal scrollbar listener.
533+
* This class exists only for backward compatibility.
534+
* All its functionality has been moved into Handler.
535+
* @deprecated
529536
*/
537+
@Deprecated(since = "17")
530538
public class HSBChangeListener implements ChangeListener
531539
{
532540
/**
@@ -565,7 +573,11 @@ protected ChangeListener createHSBChangeListener() {
565573

566574
/**
567575
* Vertical scrollbar listener.
576+
* This class exists only for backward compatibility.
577+
* All its functionality has been moved into Handler.
578+
* @deprecated
568579
*/
580+
@Deprecated(since = "17")
569581
public class VSBChangeListener implements ChangeListener
570582
{
571583
/**
@@ -770,7 +782,11 @@ private void updateScrollBar(PropertyChangeEvent pce, ChangeListener cl,
770782

771783
/**
772784
* Property change handler.
785+
* This class exists only for backward compatibility.
786+
* All its functionality has been moved into Handler.
787+
* @deprecated
773788
*/
789+
@Deprecated(since = "17")
774790
public class PropertyChangeHandler implements PropertyChangeListener
775791
{
776792
/**

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -548,7 +548,10 @@ private Border createNonRolloverToggleBorder() {
548548
* @param toolbar an instance of {@code JToolBar}
549549
* @return an instance of {@code JFrame}
550550
* @see #createFloatingWindow
551+
* @deprecated It is recommended that {@link BasicToolBarUI#createFloatingWindow(JToolBar)}
552+
* be used instead
551553
*/
554+
@Deprecated(since = "17")
552555
protected JFrame createFloatingFrame(JToolBar toolbar) {
553556
Window window = SwingUtilities.getWindowAncestor(toolbar);
554557
@SuppressWarnings("serial") // anonymous class

0 commit comments

Comments
 (0)