JDK-6385277 : testcase 4774166 is failing on Linux but passing on Solaris and Windows with Tiger JDKS.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0u7,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_redhat_3.0,linux_suse_sles_9
  • CPU: x86
  • Submitted: 2006-02-14
  • Updated: 2011-01-19
  • Resolved: 2006-04-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other JDK 6
5.0u8Fixed 6 b83Fixed
Related Reports
Duplicate :  
Testcase from regression workspace, bug4774166.java is failing on Linux but passing on Solaris and Windows platforms with Tiger JDKS.

Testcase Location:

java -version
java version "1.5.0_07-ea"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-ea-b01)
Java HotSpot(TM) Client VM (build 1.5.0_07-ea-b01, mixed mode, sharing)

Operating System: 
cat /etc/SuSE-release
SUSE LINUX Enterprise Server 9 (i586)

Steps to reproduce:
1. Install JDK in test machine.
2. copy attached .java files ( bug4774166.java, JRobot.java and Util.java) into test machine.
3. Compile *.java files with tested JDK with following command:
   <jdk location>/bin/javac *.java
4. Start the test with the following command:
   <jdk location>/bin/java bug4774166

Exception in thread "main" java.lang.RuntimeException: Focus error. Test failed!
        at bug4774166.main(bug4774166.java:153)

SUGGESTED FIX The first fix failed and was changed. So the whole fix to this problem includes the following changes: 1) http://sa.sfbay.sun.com/projects/awt_data/mustang/6385277.5/ 2) http://sa.sfbay.sun.com/projects/awt_data/mustang/6385277 (also available here: http://javaweb.sfbay/jcg/1.6.0-mustang/awt/6385277) There have been created two regression tests (see the webrevs).

EVALUATION The fix integrated into b79 failed. The reason was that some client code gets executed on AppContext it doesn't belong to. This causes some problem with focuses in this particular case.

SUGGESTED FIX See the webrev here: http://javaweb.sfbay/jcg/1.6.0-mustang/awt/6385277

EVALUATION I exchanged email with Anton, who indicated XAWT has a different focus model than windows such that it's up to AWT to handle focusing the windows. From Anton: > On Windows when user clicks in a window it immediately gets activation message > from the native system. On XAWT simple window doesn't get natively activated. > This is due to the focus model used by XAWT. WM doesn't manage focus for > simple windows at all. It's AWT that completely takes this responsibility. > Currently native focus is requested on a simple window via requestFocus() > call on some of window's components. Anton believes the fix should be done in XAWT and has suggested I reassign to AWT. I'm more than happy to comply:)

EVALUATION Here's the scenario the test is failing under: . The window (JWindow) testwindow does not have focus. The last component in the Window that had focus is windowtf1. . A mouse click is generated via Robot on the JTextField windowtf2 which is contained in testwindow. . The click results in JTextField doing a requestFocus. An InputVerifier is installed on windowtf1 that always returns false from verify, implying focus should not be moved. The requestFocus on windowtf2 results in the InputVerifier returning false which means requestFocus will not be propagated to super in JComponent. On Windows (didn't test solaris) this scenario results in focus going back to windowtf1 (the last component that had focus in testwindow), which is the expected behavior. On linux focus gets lost. The curious thing is if we're denying the requestFocus request, how does the window get focus, and how come it works on some platforms. Contacting AWT for more information.