-
Bug
-
Resolution: Incomplete
-
P4
-
None
-
17.0.9
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Windows 10, Java 17, 21
A DESCRIPTION OF THE PROBLEM :
The field newFocusOwner (private static Component) in KeyboardFocusManager does not get cleared and there is no way to clear it programmatically.
Depending on the referenced component, this keeps a whole tree of components and other related objects in memory.
This is not only a memory-consumption issue, but also a problem trying to keep the application in 'clean' state.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Sorry - can't reliably describe a way to reproduce.
Often this happens when having a Ok/Cancel-JOptionPane and there selecting the Cancel-option.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
newFocuOwner to be cleared 'reliably'
ACTUAL -
newFocusOwner keeps a reference to an otherwise unreferenced component
---------- BEGIN SOURCE ----------
Sorry, up to now I could not find a simple example to reproduce it.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None from normal user point of view.
Maybe instead of having a direct static reference
private static Component newFocusOwner
it can be solved by using a WeakReference:
private static WeakReference<Component> newFocusOwner
in KeyboardFocusManager.
FREQUENCY : often
Windows 10, Java 17, 21
A DESCRIPTION OF THE PROBLEM :
The field newFocusOwner (private static Component) in KeyboardFocusManager does not get cleared and there is no way to clear it programmatically.
Depending on the referenced component, this keeps a whole tree of components and other related objects in memory.
This is not only a memory-consumption issue, but also a problem trying to keep the application in 'clean' state.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Sorry - can't reliably describe a way to reproduce.
Often this happens when having a Ok/Cancel-JOptionPane and there selecting the Cancel-option.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
newFocuOwner to be cleared 'reliably'
ACTUAL -
newFocusOwner keeps a reference to an otherwise unreferenced component
---------- BEGIN SOURCE ----------
Sorry, up to now I could not find a simple example to reproduce it.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None from normal user point of view.
Maybe instead of having a direct static reference
private static Component newFocusOwner
it can be solved by using a WeakReference:
private static WeakReference<Component> newFocusOwner
in KeyboardFocusManager.
FREQUENCY : often