JDK-6689468 : test/closed/java/awt/Component/VisibleHwInLwContTest/VisibleHwInLwContTest.html fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,linux
  • CPU: generic
  • Submitted: 2008-04-16
  • Updated: 2011-01-19
  • Resolved: 2009-09-16
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 7
7 b72Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
test/closed/java/awt/Component/VisibleHwInLwContTest/VisibleHwInLwContTest.html fails with promoted JDK7b25 and latest local build on linux (KDE) with the following output.
Test passes with JDK7b19. Not tried other builds.
The test passes on Windows2000.

#Test Results (version 2)
#Wed Apr 16 17:08:42 MSD 2008
#checksum:3dcffe9b3c4c4dc5
#-----testdescription-----
$file=<dir>/jdk/test/closed/java/awt/Component/VisibleHwInLwContTest/VisibleHwInLwContTest.html
$root=<dir>/test
author=###@###.###: area=awt.Component
keywords=bug4818916
run=USER_SPECIFIED applet VisibleHwInLwContTest.html\n
source=VisibleHwInLwContTest.html
title=CardLayout heavyweight makes lightweight visible

#-----environment-----

#-----testresult-----
description=file://<dir>/jdk/test/closed/java/awt/Component/VisibleHwInLwContTest/VisibleHwInLwContTest.html
end=Wed Apr 16 17:08:42 MSD 2008
environment=regtest
execStatus=Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: Test failed.  Action performed on invisible button.
javatestOS=Linux 2.6.11.4-20a-default (i386)
javatestVersion=2.1.5
script=com.sun.javatest.regtest.RegressionScript 
sections=script_messages build applet
start=Wed Apr 16 17:08:35 MSD 2008
status=Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: Test failed.  Action performed on invisible button.
test=closed/java/awt/Component/VisibleHwInLwContTest/VisibleHwInLwContTest.html
work=<dir>/jdk/test/closed/java/awt/Component/VisibleHwInLwContTest/JTwork/closed/java/awt/Component/VisibleHwInLwContTest

#section:script_messages
----------messages:(4/181)----------
JDK under test: (/home/id/tmp/linux-i586)
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b25)
Java HotSpot(TM) Client VM (build 12.0-b01, mixed mode)

#section:build
----------messages:(3/107)----------
command: build VisibleHwInLwContTest 
reason: Named class compiled on demand
elapsed time (seconds): 0.011
result: Passed. No need to compile: VisibleHwInLwContTest.java

#section:applet
----------messages:(3/143)----------
command: applet VisibleHwInLwContTest.html
reason: User specified action: run applet VisibleHwInLwContTest.html 
elapsed time (seconds): 6.829
----------System.out:(1/47)----------
Any messages for the tester will display here.
----------System.err:(6/410)----------
actionPerformed
java.lang.RuntimeException: Test failed.  Action performed on invisible button.
	at VisibleHwInLwContTest.start(VisibleHwInLwContTest.java:96)
	at com.sun.javatest.regtest.AppletWrapper$AppletThread.run(AppletWrapper.java:145)
	at java.lang.Thread.run(Thread.java:674)
STATUS:Failed.Applet thread threw exception: java.lang.RuntimeException: Test failed.  Action performed on invisible button.
result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: Test failed.  Action performed on invisible button.


test result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: Test failed.  Action performed on invisible button.

Comments
EVALUATION When fixing 4993545, the relocateComponent() call has been placed in the addNotify() method in order to correctly position the HW component. However, it's been forgotten to also verify the actual visibility of the component and hide the peer if needed. To fix this issue we must hide the peer in the addNotify() method if the component is not recursively visible.
26-08-2009

SUGGESTED FIX --- old/src/share/classes/java/awt/Component.java 2009-08-26 16:56:41.000000000 +0400 +++ new/src/share/classes/java/awt/Component.java 2009-08-26 16:56:41.000000000 +0400 @@ -6665,6 +6665,9 @@ Container parent = this.parent; if (parent != null && parent.peer instanceof LightweightPeer) { relocateComponent(); + if (!isRecursivelyVisible()) { + peer.setVisible(false); + } } } invalidate();
26-08-2009

EVALUATION This looks like a regression of 4993545: 1. The fix got integrated into 7b25. 2. It heavily affected the way heavyweight components live within lightweight containers. 3. The problem is not reproducible with 6u14, where the fix is not present, though all the rest of the hw/lw mixing feature is.
10-03-2009

EVALUATION This may (or may not) be related to 6689303. Reproducible on all the platforms with 7.0-b25 and not reproducible with 7.0-b21
18-04-2008