-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0, 5.0
-
beta2
-
generic, x86
-
generic, windows_2000
Because the new implementations of DefaultFocusManager and
setNextFocusableComponent are designed to cope with mixed 1.4/pre-1.4
environments, they will defer some of their operations to other objects if they
detect such an environment. Unfortunately, mixing of these two APIs makes the
new code think that it is operating in such an environment when it really isn't.
Because an instance of HardCodedFocusTraversalPolicy is interposed between the
DFM and the LegacyGlueFocusTraversalPolicy, the DFM doesn't notice that the
environment is pure legacy. The code eventually goes into an infinite loop and
generates a StackOverflowException. Here is a portion of the stack trace:
java.lang.StackOverflowError
at
javax.swing.LegacyGlueFocusTraversalPolicy.getLastComponent(DefaultFoc
usManager.java:156)
at
javax.swing.HardCodedFocusTraversalPolicy.getLastComponent(HardCodedFo
cusTraversalPolicy.java:109)
at
javax.swing.DefaultFocusManager.getLastComponent(DefaultFocusManager.j
ava:118)
at
javax.swing.LegacyGlueFocusTraversalPolicy.getLastComponent(DefaultFoc
usManager.java:156)
at
javax.swing.HardCodedFocusTraversalPolicy.getLastComponent(HardCodedFo
cusTraversalPolicy.java:109)
at
javax.swing.DefaultFocusManager.getLastComponent(DefaultFocusManager.j
ava:118)
[...]
setNextFocusableComponent are designed to cope with mixed 1.4/pre-1.4
environments, they will defer some of their operations to other objects if they
detect such an environment. Unfortunately, mixing of these two APIs makes the
new code think that it is operating in such an environment when it really isn't.
Because an instance of HardCodedFocusTraversalPolicy is interposed between the
DFM and the LegacyGlueFocusTraversalPolicy, the DFM doesn't notice that the
environment is pure legacy. The code eventually goes into an infinite loop and
generates a StackOverflowException. Here is a portion of the stack trace:
java.lang.StackOverflowError
at
javax.swing.LegacyGlueFocusTraversalPolicy.getLastComponent(DefaultFoc
usManager.java:156)
at
javax.swing.HardCodedFocusTraversalPolicy.getLastComponent(HardCodedFo
cusTraversalPolicy.java:109)
at
javax.swing.DefaultFocusManager.getLastComponent(DefaultFocusManager.j
ava:118)
at
javax.swing.LegacyGlueFocusTraversalPolicy.getLastComponent(DefaultFoc
usManager.java:156)
at
javax.swing.HardCodedFocusTraversalPolicy.getLastComponent(HardCodedFo
cusTraversalPolicy.java:109)
at
javax.swing.DefaultFocusManager.getLastComponent(DefaultFocusManager.j
ava:118)
[...]