<Swing Dev> JDK-8190348: [TESTBUG] Test javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java fails

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Fri Nov 17 05:52:44 UTC 2017


+1

Regards
Prasanta
On 11/16/2017 4:28 PM, Pankaj Bansal wrote:
>
> Hi All,
>
> Please review the fix for JDK 10.
>
> Bug:
>
> https://bugs.openjdk.java.net/browse/JDK-8190348
>
> Webrev:
>
> http://cr.openjdk.java.net/~pbansal/8190348/webrev.00/ 
> <http://cr.openjdk.java.net/%7Epbansal/8190348/webrev.00/>
>
> Issue:
>
> The test fails with or without HiDPI with Exception.
>
> Failed. Execution failed: `main' threw exception: 
> java.lang.RuntimeException: bounds = 
> java.awt.Rectangle[x=74,y=40,width=181,height=185] loc = 
> java.awt.Point[x=274,y=240] background loc = 100, 100 so middle point 
> over background is 264, 232 Oval is not opaque in the middle point 
> (364, 332, java.awt.Color[r=51,g=51,b=51])
>
> Fix:
>
> The test case creates a class PerPixelTranslucentCanvas which drives 
> from Common class. It has a instance variable OVAL_COLOR. In the 
> constructor, it is calling super class constructor which in turn calls 
> createSwingComponents function which is overridden by 
> PerPixelTranslucentCanvas. This function uses the OVAL_COLOR. The 
> instance variables are loaded before the class construction, but after 
> the super constructor has been called. As the variable is not static, 
> it is not yet loaded and null is used. So this variable should be 
> static, so that it is created on class loading.
>
> There are variables BG_COLOR and FG_COLOR in common class which are 
> static as well.
>
> Also added an addition @run to run the test at HiDPI also like other 
> tests in the same folder.
>
> Regards,
>
> Pankaj Bansal
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20171117/81754bc6/attachment.html>


More information about the swing-dev mailing list