Review request for 7125044 - [macosx] Test failure because Component.transferFocus() works differently in applet and application.

Artem Ananiev artem.ananiev at
Mon Feb 27 15:58:54 PST 2012

Here is the text from 7125044's Suggested Fix:

---- quote begins ----

In the fix it's assumed that swing toplevel initialization process 
initiates JRootPane creation which in its turn updates UI where swing 
layout focus policy is eventually set. For exmple, for JFrame the stack 
looks as follows:

	at javax.swing.UIManager.maybeInitializeFocusPolicy(
	at javax.swing.UIManager.getUI(
	at javax.swing.JRootPane.updateUI(
	at javax.swing.JRootPane.<init>(
	at javax.swing.JFrame.createRootPane(
	at javax.swing.JFrame.frameInit(
	at javax.swing.JFrame.<init>(

Also the fix eliminates the code in SunToolkit.checkAndSetPolicy(..) 
that determined focus traversal policy for XAWT container. Now the 
policy is taken from KeyboardFocusManager strictly following javadoc.

---- quote ends ----

In general, the fix is a little bit hacky (see Anton's assumption about 
Swing initialization above), but it's definitely simpler and clearer 
than the current code. So I'm fine with it.


did you consider creating a new test, or several regression tests with 
this fix? For example, a test that checks that in a pure AWT application 
the default policy is DFTP (even if it contains text components and runs 
on X11).



On 2/27/2012 3:02 PM, Roger Lewis wrote:
> The bugs are available, but this view does not include the Suggested Fix
> field.
> On 2/27/12 2:23 PM, Mike Swingler wrote:
>> On Feb 27, 2012, at 9:05 AM, Anton V. Tarasov wrote:
>>> Detailed description:
>>> Fix description:
> -Roger
>> Neither of these are visible outside of Oracle.
>> Regards,
>> Mike Swingler
>> Apple Inc.

More information about the macosx-port-dev mailing list