JDK-6680240 : Two regression testcases fails from 1.6.0_10 b12 onwards
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2008-03-26
  • Updated: 2011-01-19
  • Resolved: 2008-04-12
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 Availability Release.

To download the current JDK release, click here.
JDK 6
6u10 b22Fixed
Related Reports
Relates :  
Description
The following two testcases should display 2 frames when executed. But when run, only one frame is being displayed. The other frame looks as if it is translucent when moved. The frame can be seen in the taskbar.

This happens for builds 1.6.0_10 b12 onwards. It works fine with the previous builds. 
This behavioiur is seen in Windows Vista as well as Windows XP Home

1.java/awt/Window/AppletWarning/AppletWarning.sh
2.java/awt/event/HierarchyEvent/UserTest/UserTest.java

In Linux and Solaris the above 2 testcases show one frame with black background from the build 1.6.0_10 b12 onwards and works fine with the previous builds .

Comments
SUGGESTED FIX $ sccs diffs -C Window.java ------- Window.java ------- *** /tmp/sccs.CePhqR 2008-03-27 16:59:21.000000000 +0300 --- Window.java 2008-03-27 16:56:10.000000000 +0300 *************** *** 2745,2750 **** --- 2745,2753 ---- if(aot) { setAlwaysOnTop(aot); // since 1.5; subject to permission check } + this.opacity = 1.0f; + this.opaque = true; + this.shape = null; deserializeResources(s); } *************** *** 3233,3247 **** /* The opacity level of the window */ ! private float opacity = 1.0f; /* The shape assigned to this window */ ! private Shape shape = null; /* Indicates whether this window is opaque (true) or translcuent (false) */ ! private boolean opaque = true; private void applyOpacity() { checkTreeLock(); --- 3236,3250 ---- /* The opacity level of the window */ ! private transient float opacity = 1.0f; /* The shape assigned to this window */ ! private transient Shape shape = null; /* Indicates whether this window is opaque (true) or translcuent (false) */ ! private transient boolean opaque = true; private void applyOpacity() { checkTreeLock();
27-03-2008

EVALUATION Indeed, the opacity, opaque, and shape fields should be transient, as well as these fields should get initialized at the readObject() method.
27-03-2008

EVALUATION It seems the problem is related to serialization in some way: if I comment out lines 70-80 in UserTest.java, the problem disappears.
27-03-2008

EVALUATION I can easy reproduce the bug on WinXP SP1 with 6u10-b12. One of the windows in UserTest is *completely* transparent, so it can be noticed only in the taskbar. The window is also transparent for all the mouse events, for example, I can't drag it by title.
27-03-2008